91 |
91 |
92 ///////////////////////////////////////////////////////////////// |
92 ///////////////////////////////////////////////////////////////// |
93 ///////////////////// CONSTANT DEFINITIONS ///////////////////// |
93 ///////////////////// CONSTANT DEFINITIONS ///////////////////// |
94 ///////////////////////////////////////////////////////////////// |
94 ///////////////////////////////////////////////////////////////// |
95 |
95 |
96 SDL_INIT_TIMER = $00000001; |
96 // SDL_Init() flags |
97 SDL_INIT_AUDIO = $00000010; |
97 SDL_INIT_TIMER = $00000001; |
98 SDL_INIT_VIDEO = $00000020; |
98 SDL_INIT_AUDIO = $00000010; |
99 SDL_INIT_JOYSTICK = $00000200; |
99 SDL_INIT_VIDEO = $00000020; |
100 {$IFDEF SDL13} |
100 SDL_INIT_JOYSTICK = $00000200; |
101 SDL_INIT_HAPTIC = $00001000; |
101 {$IFDEF SDL13} |
102 {$ELSE} |
102 SDL_INIT_HAPTIC = $00001000; |
103 SDL_INIT_CDROM = $00000100; |
103 {$ELSE} |
|
104 SDL_INIT_CDROM = $00000100; |
|
105 SDL_INIT_EVENTTHREAD = $01000000; |
104 {$ENDIF} |
106 {$ENDIF} |
105 SDL_INIT_NOPARACHUTE = $00100000; |
107 SDL_INIT_NOPARACHUTE = $00100000; |
106 SDL_INIT_EVENTTHREAD = $01000000; |
|
107 SDL_INIT_EVERYTHING = $0000FFFF; |
108 SDL_INIT_EVERYTHING = $0000FFFF; |
108 |
109 |
109 SDL_APPINPUTFOCUS = 2; |
110 SDL_APPINPUTFOCUS = $02; |
110 SDL_BUTTON_WHEELUP = 4; |
111 SDL_BUTTON_WHEELUP = 4; |
111 SDL_BUTTON_WHEELDOWN = 5; |
112 SDL_BUTTON_WHEELDOWN = 5; |
112 |
113 |
113 {$IFDEF SDL13} |
114 {$IFDEF SDL13} |
114 // SDL_Event types |
115 // SDL_Event types |
115 SDL_FIRSTEVENT = 0; |
116 SDL_FIRSTEVENT = 0; |
116 SDL_QUITEV = $100; |
117 SDL_QUITEV = $100; |
117 SDL_WINDOWEVENT = $200; |
118 SDL_WINDOWEVENT = $200; |
118 SDL_SYSWMEVENT = $201; |
119 SDL_SYSWMEVENT = $201; |
119 SDL_KEYDOWN = $300; |
120 SDL_KEYDOWN = $300; |
120 SDL_KEYUP = $301; |
121 SDL_KEYUP = $301; |
121 SDL_TEXTEDITING = $302; |
122 SDL_TEXTEDITING = $302; |
122 SDL_TEXTINPUT = $303; |
123 SDL_TEXTINPUT = $303; |
123 SDL_MOUSEMOTION = $400; |
124 SDL_MOUSEMOTION = $400; |
124 SDL_MOUSEBUTTONDOWN = $401; |
125 SDL_MOUSEBUTTONDOWN = $401; |
125 SDL_MOUSEBUTTONUP = $402; |
126 SDL_MOUSEBUTTONUP = $402; |
126 SDL_MOUSEWHEEL = $403; |
127 SDL_MOUSEWHEEL = $403; |
127 SDL_PROXIMITYIN = $500; |
128 SDL_INPUTMOTION = $500; |
128 SDL_PROXIMITYOUT = $501; |
129 SDL_INPUTBUTTONDOWN = $501; |
129 SDL_JOYAXISMOTION = $600; |
130 SDL_INPUTBUTTONUP = $502; |
130 SDL_JOYBALLMOTION = $601; |
131 SDL_INPUTWHEEL = $503; |
131 SDL_JOYHATMOTION = $602; |
132 SDL_INPUTPROXIMITYIN = $504; |
132 SDL_JOYBUTTONDOWN = $603; |
133 SDL_INPUTPROXIMITYOUT = $505; |
133 SDL_JOYBUTTONUP = $604; |
134 SDL_JOYAXISMOTION = $600; |
134 SDL_USEREVENT = $8000; |
135 SDL_JOYBALLMOTION = $601; |
135 SDL_LASTEVENT = $FFFF; |
136 SDL_JOYHATMOTION = $602; |
|
137 SDL_JOYBUTTONDOWN = $603; |
|
138 SDL_JOYBUTTONUP = $604; |
|
139 //TODO: implement otheer event types |
|
140 SDL_USEREVENT = $8000; |
|
141 SDL_LASTEVENT = $FFFF; |
136 |
142 |
137 // SDL_Surface flags |
143 // SDL_Surface flags |
138 SDL_SWSURFACE = $00000000; //*< Not used */ |
144 SDL_SWSURFACE = $00000000; //*< Not used */ |
139 SDL_PREALLOC = $00000001; //*< Surface uses preallocated memory */ |
145 SDL_PREALLOC = $00000001; //*< Surface uses preallocated memory */ |
140 SDL_RLEACCEL = $00000002; //*< Surface is RLE encoded */ |
146 SDL_RLEACCEL = $00000002; //*< Surface is RLE encoded */ |
151 SDL_HWSURFACE = $08000001; //*< Not used */ |
157 SDL_HWSURFACE = $08000001; //*< Not used */ |
152 SDL_ASYNCBLIT = $08000000; //*< Not used */ |
158 SDL_ASYNCBLIT = $08000000; //*< Not used */ |
153 SDL_RLEACCELOK = $08000000; //*< Not used */ |
159 SDL_RLEACCELOK = $08000000; //*< Not used */ |
154 SDL_HWACCEL = $08000000; //*< Not used */ |
160 SDL_HWACCEL = $08000000; //*< Not used */ |
155 |
161 |
|
162 // SDL_Renderer flags |
|
163 SDL_RENDERER_SOFTWARE = $00000001; //*< The renderer is a software fallback */ |
|
164 SDL_RENDERER_ACCELERATED = $00000002; //*< The renderer uses hardware acceleration */ |
|
165 SDL_RENDERER_PRESENTVSYNC = $00000004; |
|
166 |
156 // SDL_WindowFlags (enum) |
167 // SDL_WindowFlags (enum) |
157 SDL_WINDOW_FULLSCREEN = $00000001; //*< fullscreen window, implies borderless */ |
168 SDL_WINDOW_FULLSCREEN = $00000001; //*< fullscreen window, implies borderless */ |
158 SDL_WINDOW_OPENGL = $00000002; //*< window usable with OpenGL context */ |
169 SDL_WINDOW_OPENGL = $00000002; //*< window usable with OpenGL context */ |
159 SDL_WINDOW_SHOWN = $00000004; //*< window is visible */ |
170 SDL_WINDOW_SHOWN = $00000004; //*< window is visible */ |
160 // SDL_WINDOW_HIDDEN = $00000008; //*< window is not visible */ |
171 SDL_WINDOW_HIDDEN = $00000008; //*< window is not visible */ |
161 SDL_WINDOW_BORDERLESS = $00000008; //*< no window decoration */ |
172 SDL_WINDOW_BORDERLESS = $00000010; //*< no window decoration */ |
162 SDL_WINDOW_RESIZABLE = $00000010; //*< window can be resized */ |
173 SDL_WINDOW_RESIZABLE = $00000020; //*< window can be resized */ |
163 SDL_WINDOW_MINIMIZED = $00000020; //*< window is minimized */ |
174 SDL_WINDOW_MINIMIZED = $00000040; //*< window is minimized */ |
164 SDL_WINDOW_MAXIMIZED = $00000040; //*< window is maximized */ |
175 SDL_WINDOW_MAXIMIZED = $00000080; //*< window is maximized */ |
165 SDL_WINDOW_INPUT_GRABBED = $00000100; //*< window has grabbed input focus */ |
176 SDL_WINDOW_INPUT_GRABBED = $00000100; //*< window has grabbed input focus */ |
166 SDL_WINDOW_INPUT_FOCUS = $00000200; //*< window has input focus */ |
177 SDL_WINDOW_INPUT_FOCUS = $00000200; //*< window has input focus */ |
167 SDL_WINDOW_MOUSE_FOCUS = $00000400; //*< window has mouse focus */ |
178 SDL_WINDOW_MOUSE_FOCUS = $00000400; //*< window has mouse focus */ |
168 SDL_WINDOW_FOREIGN = $00000800; //*< window not created by SDL */ |
179 SDL_WINDOW_FOREIGN = $00000800; //*< window not created by SDL */ |
169 |
180 |
174 SDL_WINDOWEVENT_SHOWN = 1; //*< Window has been shown |
185 SDL_WINDOWEVENT_SHOWN = 1; //*< Window has been shown |
175 SDL_WINDOWEVENT_HIDDEN = 2; //*< Window has been hidden |
186 SDL_WINDOWEVENT_HIDDEN = 2; //*< Window has been hidden |
176 SDL_WINDOWEVENT_EXPOSED = 3; //*< Window has been exposed and should be redrawn |
187 SDL_WINDOWEVENT_EXPOSED = 3; //*< Window has been exposed and should be redrawn |
177 SDL_WINDOWEVENT_MOVED = 4; //*< Window has been moved to data1, data2 |
188 SDL_WINDOWEVENT_MOVED = 4; //*< Window has been moved to data1, data2 |
178 SDL_WINDOWEVENT_RESIZED = 5; //*< Window size changed to data1xdata2 |
189 SDL_WINDOWEVENT_RESIZED = 5; //*< Window size changed to data1xdata2 |
179 SDL_WINDOWEVENT_MINIMIZED = 6; //*< Window has been minimized |
190 SDL_WINDOWEVENT_SIZE_CHANGED = 6; //*< The window size has changed, [...] */ |
180 SDL_WINDOWEVENT_MAXIMIZED = 7; //*< Window has been maximized |
191 SDL_WINDOWEVENT_MINIMIZED = 7; //*< Window has been minimized |
181 SDL_WINDOWEVENT_RESTORED = 8; //*< Window has been restored to normal size and position |
192 SDL_WINDOWEVENT_MAXIMIZED = 8; //*< Window has been maximized |
182 SDL_WINDOWEVENT_ENTER = 9; //*< Window has gained mouse focus |
193 SDL_WINDOWEVENT_RESTORED = 9; //*< Window has been restored to normal size and position |
183 SDL_WINDOWEVENT_LEAVE = 10; //*< Window has lost mouse focus |
194 SDL_WINDOWEVENT_ENTER = 10; //*< Window has gained mouse focus |
184 SDL_WINDOWEVENT_FOCUS_GAINED = 11; //*< Window has gained keyboard focus |
195 SDL_WINDOWEVENT_LEAVE = 11; //*< Window has lost mouse focus |
185 SDL_WINDOWEVENT_FOCUS_LOST = 12; //*< Window has lost keyboard focus |
196 SDL_WINDOWEVENT_FOCUS_GAINED = 12; //*< Window has gained keyboard focus |
186 SDL_WINDOWEVENT_CLOSE = 13; //*< The window manager requests that the window be closed */ |
197 SDL_WINDOWEVENT_FOCUS_LOST = 13; //*< Window has lost keyboard focus |
187 |
198 SDL_WINDOWEVENT_CLOSE = 14; //*< The window manager requests that the window be closed */ |
188 SDL_RENDERER_ACCELERATED = $00000001; //*< The renderer uses hardware acceleration |
|
189 SDL_RENDERER_PRESENTVSYNC = $00000002; //*< Present is synchronized with the refresh rate |
|
190 {$ELSE} |
199 {$ELSE} |
191 // SDL_Event types |
200 // SDL_Event types |
192 SDL_NOEVENT = 0; |
201 SDL_NOEVENT = 0; |
193 SDL_ACTIVEEVENT = 1; |
202 SDL_ACTIVEEVENT = 1; |
194 SDL_KEYDOWN = 2; |
203 SDL_KEYDOWN = 2; |
325 format: PSDL_PixelFormat; |
353 format: PSDL_PixelFormat; |
326 w, h : LongInt; |
354 w, h : LongInt; |
327 pitch : Word; |
355 pitch : Word; |
328 pixels: Pointer; |
356 pixels: Pointer; |
329 offset: LongInt; |
357 offset: LongInt; |
|
358 {$IFDEF SDL13} |
|
359 userdata: Pointer; |
|
360 locked: LongInt; |
|
361 lock_data: Pointer; |
|
362 clip_rect: TSDL_Rect; |
|
363 map: Pointer; |
|
364 refcount: LongInt; |
|
365 {$ENDIF} |
330 end; |
366 end; |
331 |
367 |
332 |
368 |
333 PSDL_Color = ^TSDL_Color; |
369 PSDL_Color = ^TSDL_Color; |
334 TSDL_Color = record |
370 TSDL_Color = record |
335 case byte of |
371 case byte of |
336 0: ( r: Byte; |
372 0: ( r: Byte; |
337 g: Byte; |
373 g: Byte; |
338 b: Byte; |
374 b: Byte; |
339 unused: Byte; |
375 unused: Byte; ); |
340 ); |
376 1: ( value: Longword; ); |
341 1: ( value: Longword); |
|
342 end; |
377 end; |
343 |
378 |
344 |
379 |
345 PSDL_RWops = ^TSDL_RWops; |
380 PSDL_RWops = ^TSDL_RWops; |
346 TSeek = function( context: PSDL_RWops; offset: LongInt; whence: LongInt ): LongInt; cdecl; |
381 TSeek = function( context: PSDL_RWops; offset: LongInt; whence: LongInt ): LongInt; cdecl; |
347 TRead = function( context: PSDL_RWops; Ptr: Pointer; size: LongInt; maxnum : LongInt ): LongInt; cdecl; |
382 TRead = function( context: PSDL_RWops; Ptr: Pointer; size: LongInt; maxnum : LongInt ): LongInt; cdecl; |
348 TWrite = function( context: PSDL_RWops; Ptr: Pointer; size: LongInt; num: LongInt ): LongInt; cdecl; |
383 TWrite = function( context: PSDL_RWops; Ptr: Pointer; size: LongInt; num: LongInt ): LongInt; cdecl; |
349 TClose = function( context: PSDL_RWops ): LongInt; cdecl; |
384 TClose = function( context: PSDL_RWops ): LongInt; cdecl; |
350 |
385 |
351 TStdio = record |
386 TStdio = record |
352 autoclose: LongInt; |
387 autoclose: {$IFDEF SDL13}boolean{$ELSE}LongInt{$ENDIF}; |
353 fp: pointer; |
388 fp: pointer; |
354 end; |
389 end; |
355 |
390 |
356 TMem = record |
391 TMem = record |
357 base: PByte; |
392 base: PByte; |
469 TSDL_MouseWheelEvent = record |
501 TSDL_MouseWheelEvent = record |
470 type_: LongInt; |
502 type_: LongInt; |
471 windowID: LongInt; |
503 windowID: LongInt; |
472 which: Byte; |
504 which: Byte; |
473 x, y: LongInt; |
505 x, y: LongInt; |
474 padding1, padding2, padding3: byte; |
506 end; |
475 end; |
507 |
476 |
508 //TODO: implement SDL_ProximityEvent |
477 // implement SDL_ProximityEvent |
|
478 {$ENDIF} |
509 {$ENDIF} |
479 |
510 |
480 TSDL_JoyAxisEvent = record |
511 TSDL_JoyAxisEvent = record |
481 {$IFDEF SDL13} |
512 type_: {$IFDEF SDL13}LongInt{$ELSE}Byte{$ENDIF}; |
482 type_: LongInt; |
|
483 {$ELSE} |
|
484 type_: Byte; |
|
485 {$ENDIF} |
|
486 which: Byte; |
513 which: Byte; |
487 axis: Byte; |
514 axis: Byte; |
488 {$IFDEF SDL13} |
515 {$IFDEF SDL13} |
|
516 padding1, padding2: Byte; |
489 value: LongInt; |
517 value: LongInt; |
490 {$ELSE} |
518 {$ELSE} |
491 value: Smallint; |
519 value: Smallint; |
492 {$ENDIF} |
520 {$ENDIF} |
493 end; |
521 end; |
494 |
522 |
495 TSDL_JoyBallEvent = record |
523 TSDL_JoyBallEvent = record |
|
524 type_: {$IFDEF SDL13}LongInt{$ELSE}Byte{$ENDIF}; |
496 which: Byte; |
525 which: Byte; |
497 ball: Byte; |
526 ball: Byte; |
498 {$IFDEF SDL13} |
527 {$IFDEF SDL13} |
499 type_: LongInt; |
528 padding1, padding2: Byte; |
500 xrel, yrel: LongInt; |
529 xrel, yrel: LongInt; |
501 {$ELSE} |
530 {$ELSE} |
502 type_: Byte; |
|
503 xrel, yrel: Smallint; |
531 xrel, yrel: Smallint; |
504 {$ENDIF} |
532 {$ENDIF} |
505 end; |
533 end; |
506 |
534 |
507 TSDL_JoyHatEvent = record |
535 TSDL_JoyHatEvent = record |
508 {$IFDEF SDL13} |
536 type_: {$IFDEF SDL13}LongInt{$ELSE}Byte{$ENDIF}; |
509 type_: LongInt; |
|
510 {$ELSE} |
|
511 type_: Byte; |
|
512 {$ENDIF} |
|
513 which: Byte; |
537 which: Byte; |
514 hat: Byte; |
538 hat: Byte; |
515 value: Byte; |
539 value: Byte; |
|
540 {$IFDEF SDL13} |
|
541 padding1: Byte; |
|
542 {$ENDIF} |
516 end; |
543 end; |
517 |
544 |
518 TSDL_JoyButtonEvent = record |
545 TSDL_JoyButtonEvent = record |
519 {$IFDEF SDL13} |
546 type_: {$IFDEF SDL13}LongInt{$ELSE}Byte{$ENDIF}; |
520 type_: LongInt; |
|
521 {$ELSE} |
|
522 type_: Byte; |
|
523 {$ENDIF} |
|
524 which: Byte; |
547 which: Byte; |
525 button: Byte; |
548 button: Byte; |
526 state: Byte; |
549 state: Byte; |
527 end; |
550 {$IFDEF SDL13} |
|
551 padding1: Byte; |
|
552 {$ENDIF} |
|
553 end; |
|
554 |
|
555 //TODO: implement SDL_TouchButtonEvent, SDL_MultiGestureEvent, SDL_DollarGestureEvent |
528 |
556 |
529 TSDL_QuitEvent = record |
557 TSDL_QuitEvent = record |
530 {$IFDEF SDL13} |
558 type_: {$IFDEF SDL13}LongInt{$ELSE}Byte{$ENDIF}; |
531 type_: LongInt; |
|
532 {$ELSE} |
|
533 type_: Byte; |
|
534 {$ENDIF} |
|
535 end; |
559 end; |
536 |
560 |
537 TSDL_UserEvent = record |
561 TSDL_UserEvent = record |
538 {$IFDEF SDL13} |
562 {$IFDEF SDL13} |
539 type_: LongInt; |
563 type_: LongInt; |
563 SDL_JOYAXISMOTION: (jaxis: TSDL_JoyAxisEvent); |
586 SDL_JOYAXISMOTION: (jaxis: TSDL_JoyAxisEvent); |
564 SDL_JOYHATMOTION: (jhat: TSDL_JoyHatEvent); |
587 SDL_JOYHATMOTION: (jhat: TSDL_JoyHatEvent); |
565 SDL_JOYBALLMOTION: (jball: TSDL_JoyBallEvent); |
588 SDL_JOYBALLMOTION: (jball: TSDL_JoyBallEvent); |
566 SDL_JOYBUTTONDOWN, |
589 SDL_JOYBUTTONDOWN, |
567 SDL_JOYBUTTONUP: (jbutton: TSDL_JoyButtonEvent); |
590 SDL_JOYBUTTONUP: (jbutton: TSDL_JoyButtonEvent); |
|
591 SDL_QUITEV: (quit: TSDL_QuitEvent); |
568 SDL_USEREVENT: (user: TSDL_UserEvent); |
592 SDL_USEREVENT: (user: TSDL_UserEvent); |
|
593 //TODO: implement other events |
569 {$ELSE} |
594 {$ELSE} |
570 case Byte of |
595 case Byte of |
571 SDL_NOEVENT: (type_: byte); |
596 SDL_NOEVENT: (type_: byte); |
572 SDL_ACTIVEEVENT: (active: TSDL_ActiveEvent); |
597 SDL_ACTIVEEVENT: (active: TSDL_ActiveEvent); |
573 SDL_KEYDOWN, |
598 SDL_KEYDOWN, |
755 function SDL_GetNumMice: LongInt; cdecl; external SDLLibName; |
780 function SDL_GetNumMice: LongInt; cdecl; external SDLLibName; |
756 function SDL_PixelFormatEnumToMasks(format: TSDL_ArrayByteOrder; bpp: PLongInt; Rmask, Gmask, Bmask, Amask: PLongInt): boolean; cdecl; external SDLLibName; |
781 function SDL_PixelFormatEnumToMasks(format: TSDL_ArrayByteOrder; bpp: PLongInt; Rmask, Gmask, Bmask, Amask: PLongInt): boolean; cdecl; external SDLLibName; |
757 |
782 |
758 function SDL_AllocFormat(format: Longword): PSDL_PixelFormat; cdecl; external SDLLibName; |
783 function SDL_AllocFormat(format: Longword): PSDL_PixelFormat; cdecl; external SDLLibName; |
759 procedure SDL_FreeFormat(pixelformat: PSDL_PixelFormat); cdecl; external SDLLibName; |
784 procedure SDL_FreeFormat(pixelformat: PSDL_PixelFormat); cdecl; external SDLLibName; |
|
785 procedure SDL_WarpMouseInWindow(window: PSDL_Window; x, y: LongInt); cdecl; external SDLLibName; |
|
786 |
|
787 procedure SDL_WarpMouse(x, y: Word); |
|
788 {$ELSE} |
|
789 procedure SDL_WarpMouse(x, y: Word); cdecl; external SDLLibName; |
|
790 |
|
791 function SDL_AllocFormat(format: Longword): PSDL_PixelFormat; |
|
792 procedure SDL_FreeFormat(pixelformat: PSDL_PixelFormat); |
760 {$ENDIF} |
793 {$ENDIF} |
761 |
794 |
762 function SDL_GetKeyState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName {$IFDEF SDL13} name 'SDL_GetKeyboardState'{$ENDIF}; |
795 function SDL_GetKeyState(numkeys: PLongInt): PByteArray; cdecl; external SDLLibName {$IFDEF SDL13} name 'SDL_GetKeyboardState'{$ENDIF}; |
763 function SDL_GetMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName; |
796 function SDL_GetMouseState(x, y: PLongInt): Byte; cdecl; external SDLLibName; |
764 function SDL_GetKeyName(key: Longword): PChar; cdecl; external SDLLibName; |
797 function SDL_GetKeyName(key: Longword): PChar; cdecl; external SDLLibName; |
765 procedure SDL_WarpMouse(x, y: Word); cdecl; external SDLLibName; |
|
766 |
798 |
767 procedure SDL_PumpEvents; cdecl; external SDLLibName; |
799 procedure SDL_PumpEvents; cdecl; external SDLLibName; |
768 function SDL_PollEvent(event: PSDL_Event): LongInt; cdecl; external SDLLibName; |
800 function SDL_PollEvent(event: PSDL_Event): LongInt; cdecl; external SDLLibName; |
769 function SDL_WaitEvent(event: PSDL_Event): LongInt; cdecl; external SDLLibName; |
801 function SDL_WaitEvent(event: PSDL_Event): LongInt; cdecl; external SDLLibName; |
770 |
802 |
858 procedure IMG_Quit; cdecl; external SDL_ImageLibName; |
890 procedure IMG_Quit; cdecl; external SDL_ImageLibName; |
859 |
891 |
860 function IMG_Load(const _file: PChar): PSDL_Surface; cdecl; external SDL_ImageLibName; |
892 function IMG_Load(const _file: PChar): PSDL_Surface; cdecl; external SDL_ImageLibName; |
861 function IMG_Load_RW(rwop: PSDL_RWops; freesrc: LongInt): PSDL_Surface; cdecl; external SDL_ImageLibName; |
893 function IMG_Load_RW(rwop: PSDL_RWops; freesrc: LongInt): PSDL_Surface; cdecl; external SDL_ImageLibName; |
862 function IMG_LoadPNG_RW(rwop: PSDL_RWops): PSDL_Surface; cdecl; external SDL_ImageLibName; |
894 function IMG_LoadPNG_RW(rwop: PSDL_RWops): PSDL_Surface; cdecl; external SDL_ImageLibName; |
863 function IMG_LoadTyped_RW(rwop: PSDL_RWops; freesrc: LongInt; _type: PChar): PSDL_Surface; cdecl; external SDL_ImageLibName; |
895 function IMG_LoadTyped_RW(rwop: PSDL_RWops; freesrc: LongInt; type_: PChar): PSDL_Surface; cdecl; external SDL_ImageLibName; |
864 |
896 |
865 (* SDL_net *) |
897 (* SDL_net *) |
866 function SDLNet_Init: LongInt; cdecl; external SDL_NetLibName; |
898 function SDLNet_Init: LongInt; cdecl; external SDL_NetLibName; |
867 procedure SDLNet_Quit; cdecl; external SDL_NetLibName; |
899 procedure SDLNet_Quit; cdecl; external SDL_NetLibName; |
868 |
900 |
882 procedure SDLNet_Write32(value: LongWord; buf: pointer); |
914 procedure SDLNet_Write32(value: LongWord; buf: pointer); |
883 function SDLNet_Read16(buf: pointer): Word; |
915 function SDLNet_Read16(buf: pointer): Word; |
884 function SDLNet_Read32(buf: pointer): LongWord; |
916 function SDLNet_Read32(buf: pointer): LongWord; |
885 |
917 |
886 implementation |
918 implementation |
|
919 uses uVariables; |
|
920 |
|
921 {$IFDEF SDL13} |
|
922 procedure SDL_WarpMouse(x, y: Word); |
|
923 begin |
|
924 SDL_WarpMouseInWindow(SDLwindow, x, y); |
|
925 end; |
|
926 {$ELSE} |
|
927 function SDL_AllocFormat(format: Longword): PSDL_PixelFormat; |
|
928 const conversionFormat: TSDL_PixelFormat = ( |
|
929 palette: nil; BitsPerPixel: 32; BytesPerPixel: 4; |
|
930 Rloss: 0; Gloss: 0; Bloss: 0; Aloss: 0; |
|
931 Rshift: RShift; Gshift: GShift; Bshift: BShift; Ashift: AShift; |
|
932 RMask: RMask; GMask: GMask; BMask: BMask; AMask: AMask; |
|
933 colorkey: 0; alpha: 255); |
|
934 begin |
|
935 format:= format; |
|
936 exit(@conversionFormat); |
|
937 end; |
|
938 |
|
939 procedure SDL_FreeFormat; |
|
940 begin |
|
941 // yay free space |
|
942 end; |
|
943 {$ENDIF} |
887 |
944 |
888 function SDL_MustLock(Surface: PSDL_Surface): Boolean; |
945 function SDL_MustLock(Surface: PSDL_Surface): Boolean; |
889 begin |
946 begin |
890 {$IFDEF SDL13} |
947 {$IFDEF SDL13} |
891 SDL_MustLock:= ((surface^.flags and SDL_RLEACCEL) <> 0) |
948 SDL_MustLock:= ((surface^.flags and SDL_RLEACCEL) <> 0) |