3425ea317679c952bc1db07dbeb937641b61c9c0
2 {
3 $Id: sdl.pas,v 1.31 2007/05/29 21:30:48 savage Exp $
5 }
6 {******************************************************************************}
7 { }
8 { JEDI-SDL : Pascal units for SDL - Simple DirectMedia Layer }
9 { Conversion of the Simple DirectMedia Layer Headers }
10 { }
11 { Portions created by Sam Lantinga <slouken@devolution.com> are }
12 { Copyright (C) 1997-2004 Sam Lantinga }
13 { 5635-34 Springhouse Dr. }
14 { Pleasanton, CA 94588 (USA) }
15 { }
16 { All Rights Reserved. }
17 { }
18 { The original files are : SDL.h }
19 { SDL_main.h }
20 { SDL_types.h }
21 { SDL_rwops.h }
22 { SDL_timer.h }
23 { SDL_audio.h }
24 { SDL_cdrom.h }
25 { SDL_joystick.h }
26 { SDL_mouse.h }
27 { SDL_keyboard.h }
28 { SDL_events.h }
29 { SDL_video.h }
30 { SDL_byteorder.h }
31 { SDL_version.h }
32 { SDL_active.h }
33 { SDL_thread.h }
34 { SDL_mutex .h }
35 { SDL_getenv.h }
36 { SDL_loadso.h }
37 { }
38 { The initial developer of this Pascal code was : }
39 { Dominique Louis <Dominique@SavageSoftware.com.au> }
40 { }
41 { Portions created by Dominique Louis are }
42 { Copyright (C) 2000 - 2004 Dominique Louis. }
43 { }
44 { }
45 { Contributor(s) }
46 { -------------- }
47 { Tom Jones <tigertomjones@gmx.de> His Project inspired this conversion }
48 { Matthias Thoma <ma.thoma@gmx.de> }
49 { }
50 { Obtained through: }
51 { Joint Endeavour of Delphi Innovators ( Project JEDI ) }
52 { }
53 { You may retrieve the latest version of this file at the Project }
54 { JEDI home page, located at http://delphi-jedi.org }
55 { }
56 { The contents of this file are used with permission, subject to }
57 { the Mozilla Public License Version 1.1 (the "License"); you may }
58 { not use this file except in compliance with the License. You may }
59 { obtain a copy of the License at }
60 { http://www.mozilla.org/MPL/MPL-1.1.html }
61 { }
62 { Software distributed under the License is distributed on an }
63 { "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or }
64 { implied. See the License for the specific language governing }
65 { rights and limitations under the License. }
66 { }
67 { Description }
68 { ----------- }
69 { }
70 { }
71 { }
72 { }
73 { }
74 { }
75 { }
76 { Requires }
77 { -------- }
78 { The SDL Runtime libraris on Win32 : SDL.dll on Linux : libSDL.so }
79 { They are available from... }
80 { http://www.libsdl.org . }
81 { }
82 { Programming Notes }
83 { ----------------- }
84 { }
85 { }
86 { }
87 { }
88 { Revision History }
89 { ---------------- }
90 { May 08 2001 - DL : Added Keyboard State Array ( See demos for how to }
91 { use ) }
92 { PKeyStateArr = ^TKeyStateArr; }
93 { TKeyStateArr = array[0..65000] of UInt8; }
94 { As most games will need it. }
95 { }
96 { April 02 2001 - DL : Added SDL_getenv.h definitions and tested version }
97 { 1.2.0 compatability. }
98 { }
99 { March 13 2001 - MT : Added Linux compatibility. }
100 { }
101 { March 10 2001 - MT : Added externalsyms for DEFINES }
102 { Changed the license header }
103 { }
104 { March 09 2001 - MT : Added Kylix Ifdefs/Deleted the uses mmsystem }
105 { }
106 { March 01 2001 - DL : Update conversion of version 1.1.8 }
107 { }
108 { July 22 2001 - DL : Added TUInt8Array and PUIntArray after suggestions }
109 { from Matthias Thoma and Eric Grange. }
110 { }
111 { October 12 2001 - DL : Various changes as suggested by Matthias Thoma and }
112 { David Acklam }
113 { }
114 { October 24 2001 - DL : Added FreePascal support as per suggestions from }
115 { Dean Ellis. }
116 { }
117 { October 27 2001 - DL : Added SDL_BUTTON macro }
118 { }
119 { November 08 2001 - DL : Bug fix as pointed out by Puthoon. }
120 { }
121 { November 29 2001 - DL : Bug fix of SDL_SetGammaRamp as pointed out by Simon}
122 { Rushton. }
123 { }
124 { November 30 2001 - DL : SDL_NOFRAME added as pointed out by Simon Rushton. }
125 { }
126 { December 11 2001 - DL : Added $WEAKPACKAGEUNIT ON to facilitate useage in }
127 { Components }
128 { }
129 { January 05 2002 - DL : Added SDL_Swap32 function as suggested by Matthias }
130 { Thoma and also made sure the _getenv from }
131 { MSVCRT.DLL uses the right calling convention }
132 { }
133 { January 25 2002 - DL : Updated conversion of SDL_AddTimer & }
134 { SDL_RemoveTimer as per suggestions from Matthias }
135 { Thoma. }
136 { }
137 { January 27 2002 - DL : Commented out exported function putenv and getenv }
138 { So that developers get used to using SDL_putenv }
139 { SDL_getenv, as they are more portable }
140 { }
141 { March 05 2002 - DL : Added FreeAnNil procedure for Delphi 4 users. }
142 { }
143 { October 23 2002 - DL : Added Delphi 3 Define of Win32. }
144 { If you intend to you Delphi 3... }
145 { ( which is officially unsupported ) make sure you }
146 { remove references to $EXTERNALSYM in this and other}
147 { SDL files. }
148 { }
149 { November 29 2002 - DL : Fixed bug in Declaration of SDL_GetRGBA that was }
150 { pointed out by Todd Lang }
151 { }
152 { April 03 2003 - DL : Added jedi-sdl.inc include file to support more }
153 { Pascal compilers. Initial support is now included }
154 { for GnuPascal, VirtualPascal, TMT and obviously }
155 { continue support for Delphi Kylix and FreePascal. }
156 { }
157 { April 08 2003 - MK : Aka Mr Kroket - Added Better FPC support }
158 { }
159 { April 24 2003 - DL : under instruction from Alexey Barkovoy, I have added}
160 { better TMT Pascal support and under instruction }
161 { from Prof. Abimbola Olowofoyeku (The African Chief),}
162 { I have added better Gnu Pascal support }
163 { }
164 { April 30 2003 - DL : under instruction from David Mears AKA }
165 { Jason Siletto, I have added FPC Linux support. }
166 { This was compiled with fpc 1.1, so remember to set }
167 { include file path. ie. -Fi/usr/share/fpcsrc/rtl/* }
168 { }
169 {
170 $Log: sdl.pas,v $
171 Revision 1.31 2007/05/29 21:30:48 savage
172 Changes as suggested by Almindor for 64bit compatibility.
174 Revision 1.30 2007/05/29 19:31:03 savage
175 Fix to TSDL_Overlay structure - thanks David Pethes (aka imcold)
177 Revision 1.29 2007/05/20 20:29:11 savage
178 Initial Changes to Handle 64 Bits
180 Revision 1.26 2007/02/11 13:38:04 savage
181 Added Nintendo DS support - Thanks Dean.
183 Revision 1.25 2006/12/02 00:12:52 savage
184 Updated to latest version
186 Revision 1.24 2006/05/18 21:10:04 savage
187 Added 1.2.10 Changes
189 Revision 1.23 2005/12/04 23:17:52 drellis
190 Added declaration of SInt8 and PSInt8
192 Revision 1.22 2005/05/24 21:59:03 savage
193 Re-arranged uses clause to work on Win32 and Linux, Thanks again Michalis.
195 Revision 1.21 2005/05/22 18:42:31 savage
196 Changes as suggested by Michalis Kamburelis. Thanks again.
198 Revision 1.20 2005/04/10 11:48:33 savage
199 Changes as suggested by Michalis, thanks.
201 Revision 1.19 2005/01/05 01:47:06 savage
202 Changed LibName to reflect what MacOS X should have. ie libSDL*-1.2.0.dylib respectively.
204 Revision 1.18 2005/01/04 23:14:41 savage
205 Changed LibName to reflect what most Linux distros will have. ie libSDL*-1.2.so.0 respectively.
207 Revision 1.17 2005/01/03 18:40:59 savage
208 Updated Version number to reflect latest one
210 Revision 1.16 2005/01/01 02:02:06 savage
211 Updated to v1.2.8
213 Revision 1.15 2004/12/24 18:57:11 savage
214 forgot to apply Michalis Kamburelis' patch to the implementation section. now fixed
216 Revision 1.14 2004/12/23 23:42:18 savage
217 Applied Patches supplied by Michalis Kamburelis ( THANKS! ), for greater FreePascal compatability.
219 Revision 1.13 2004/09/30 22:31:59 savage
220 Updated with slightly different header comments
222 Revision 1.12 2004/09/12 21:52:58 savage
223 Slight changes to fix some issues with the sdl classes.
225 Revision 1.11 2004/08/14 22:54:30 savage
226 Updated so that Library name defines are correctly defined for MacOS X.
228 Revision 1.10 2004/07/20 23:57:33 savage
229 Thanks to Paul Toth for spotting an error in the SDL Audio Convertion structures.
230 In TSDL_AudioCVT the filters variable should point to and array of pointers and not what I had there previously.
232 Revision 1.9 2004/07/03 22:07:22 savage
233 Added Bitwise Manipulation Functions for TSDL_VideoInfo struct.
235 Revision 1.8 2004/05/10 14:10:03 savage
236 Initial MacOS X support. Fixed defines for MACOS ( Classic ) and DARWIN ( MacOS X ).
238 Revision 1.7 2004/04/13 09:32:08 savage
239 Changed Shared object names back to just the .so extension to avoid conflicts on various Linux/Unix distros. Therefore developers will need to create Symbolic links to the actual Share Objects if necessary.
241 Revision 1.6 2004/04/01 20:53:23 savage
242 Changed Linux Shared Object names so they reflect the Symbolic Links that are created when installing the RPMs from the SDL site.
244 Revision 1.5 2004/02/22 15:32:10 savage
245 SDL_GetEnv Fix so it also works on FPC/Linux. Thanks to Rodrigo for pointing this out.
247 Revision 1.4 2004/02/21 23:24:29 savage
248 SDL_GetEnv Fix so that it is not define twice for FPC. Thanks to Rene Hugentobler for pointing out this bug,
250 Revision 1.3 2004/02/18 22:35:51 savage
251 Brought sdl.pas up to 1.2.7 compatability
252 Thus...
253 Added SDL_GL_STEREO,
254 SDL_GL_MULTISAMPLEBUFFERS,
255 SDL_GL_MULTISAMPLESAMPLES
257 Add DLL/Shared object functions
258 function SDL_LoadObject( const sofile : PChar ) : Pointer;
260 function SDL_LoadFunction( handle : Pointer; const name : PChar ) : Pointer;
262 procedure SDL_UnloadObject( handle : Pointer );
264 Added function to create RWops from const memory: SDL_RWFromConstMem()
265 function SDL_RWFromConstMem(const mem: Pointer; size: Integer) : PSDL_RWops;
267 Ported SDL_cpuinfo.h so Now you can test for Specific CPU types.
269 Revision 1.2 2004/02/17 21:37:12 savage
270 Tidying up of units
272 Revision 1.1 2004/02/05 00:08:20 savage
273 Module 1.0 release
275 }
276 {******************************************************************************}
278 {$I jedi-sdl.inc}
280 interface
282 uses
283 {$IFDEF __GPC__}
284 system,
285 {$IFDEF WINDOWS}
286 wintypes,
287 {$ELSE}
288 {$ENDIF}
289 gpc;
290 {$ENDIF}
292 {$IFDEF HAS_TYPES}
294 {$ENDIF}
296 {$IFDEF WINDOWS}
297 Windows;
298 {$ENDIF}
300 {$IFDEF OS2}
301 doscalls;
302 {$ENDIF OS2}
304 {$IFDEF UNIX}
305 {$IFDEF FPC}
306 pthreads,
307 unixtype,
308 baseunix,
309 {$IFNDEF GP2X}
310 unix,
311 {$ELSE}
312 unix;
313 {$ENDIF}
314 {$IFNDEF GP2X}
315 x,
316 xlib;
317 {$ENDIF}
318 {$ELSE}
319 Libc,
320 Xlib;
321 {$ENDIF}
322 {$ENDIF}
324 {$IFDEF __MACH__}
325 GPCMacOSAll;
326 {$ENDIF}
328 {$IFDEF MORPHOS}
329 exec;
330 {$ENDIF}
332 const
333 {$IFDEF WINDOWS}
335 {$ENDIF}
337 {$IFDEF OS2}
339 {$ENDIF OS2}
341 {$IFDEF UNIX}
342 {$IFDEF DARWIN}
344 {$linklib libSDL-1.2.0}
345 {$linklib SDLmain}
346 {$linkframework Cocoa}
347 {$PASCALMAINNAME SDL_main}
348 {$ELSE}
349 {$IFDEF FPC}
351 {$ELSE}
353 {$ENDIF}
354 {$ENDIF}
355 {$ENDIF}
357 {$IFDEF MACOS}
359 {$ENDIF}
361 {$IFDEF NDS}
363 {$linklib libSDL.a}
364 {$linklib libnds9.a}
365 {$linklib libc.a}
366 {$linklib libgcc.a}
367 {$linklib libsysbase.a}
368 {$ENDIF}
370 {$IFDEF MORPHOS}
372 {$ENDIF}
374 // SDL_verion.h constants
375 // Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
377 {$EXTERNALSYM SDL_MAJOR_VERSION}
379 {$EXTERNALSYM SDL_MINOR_VERSION}
381 {$EXTERNALSYM SDL_PATCHLEVEL}
383 // SDL.h constants
385 {$EXTERNALSYM SDL_INIT_TIMER}
387 {$EXTERNALSYM SDL_INIT_AUDIO}
389 {$EXTERNALSYM SDL_INIT_VIDEO}
391 {$EXTERNALSYM SDL_INIT_CDROM}
393 {$EXTERNALSYM SDL_INIT_JOYSTICK}
395 {$EXTERNALSYM SDL_INIT_NOPARACHUTE}
397 {$EXTERNALSYM SDL_INIT_EVENTTHREAD}
399 {$EXTERNALSYM SDL_INIT_EVERYTHING}
401 // SDL_error.h constants
403 {$EXTERNALSYM ERR_MAX_STRLEN}
405 {$EXTERNALSYM ERR_MAX_ARGS}
407 // SDL_types.h constants
409 {$EXTERNALSYM SDL_PRESSED}
411 {$EXTERNALSYM SDL_RELEASED}
413 // SDL_timer.h constants
414 // This is the OS scheduler timeslice, in milliseconds
416 {$EXTERNALSYM SDL_TIMESLICE}
417 // This is the maximum resolution of the SDL timer on all platforms
419 {$EXTERNALSYM TIMER_RESOLUTION}
421 // SDL_audio.h constants
423 {$EXTERNALSYM AUDIO_U8}
425 {$EXTERNALSYM AUDIO_S8}
427 {$EXTERNALSYM AUDIO_U16LSB}
429 {$EXTERNALSYM AUDIO_S16LSB}
431 {$EXTERNALSYM AUDIO_U16MSB}
433 {$EXTERNALSYM AUDIO_S16MSB}
435 {$EXTERNALSYM AUDIO_U16}
437 {$EXTERNALSYM AUDIO_S16}
440 // SDL_cdrom.h constants
441 // The maximum number of CD-ROM tracks on a disk
443 {$EXTERNALSYM SDL_MAX_TRACKS}
444 // The types of CD-ROM track possible
446 {$EXTERNALSYM SDL_AUDIO_TRACK}
448 {$EXTERNALSYM SDL_DATA_TRACK}
450 // Conversion functions from frames to Minute/Second/Frames and vice versa
452 {$EXTERNALSYM CD_FPS}
453 // SDL_byteorder.h constants
454 // The two types of endianness
456 {$EXTERNALSYM SDL_LIL_ENDIAN}
458 {$EXTERNALSYM SDL_BIG_ENDIAN}
460 {$IFDEF IA32}
463 {$EXTERNALSYM SDL_BYTEORDER}
464 // Native audio byte ordering
466 {$EXTERNALSYM AUDIO_U16SYS}
468 {$EXTERNALSYM AUDIO_S16SYS}
470 {$ELSE}
473 {$EXTERNALSYM SDL_BYTEORDER}
474 // Native audio byte ordering
476 {$EXTERNALSYM AUDIO_U16SYS}
478 {$EXTERNALSYM AUDIO_S16SYS}
480 {$ENDIF}
484 {$EXTERNALSYM SDL_MIX_MAXVOLUME}
486 // SDL_joystick.h constants
488 {$EXTERNALSYM MAX_JOYSTICKS}
490 {$EXTERNALSYM MAX_AXES}
492 {$EXTERNALSYM MAX_BUTTONS}
494 {$EXTERNALSYM AXIS_MIN}
496 {$EXTERNALSYM AXIS_MAX}
498 {$EXTERNALSYM JOY_AXIS_THRESHOLD}
499 //JOY_BUTTON_FLAG(n) (1<<n)
500 // array to hold joystick ID values
501 //static UInt SYS_JoystickID[MAX_JOYSTICKS];
502 //static JOYCAPS SYS_Joystick[MAX_JOYSTICKS];
504 { Get the current state of a POV hat on a joystick
505 The return value is one of the following positions: }
507 {$EXTERNALSYM SDL_HAT_CENTERED}
509 {$EXTERNALSYM SDL_HAT_UP}
511 {$EXTERNALSYM SDL_HAT_RIGHT}
513 {$EXTERNALSYM SDL_HAT_DOWN}
515 {$EXTERNALSYM SDL_HAT_LEFT}
517 {$EXTERNALSYM SDL_HAT_RIGHTUP}
519 {$EXTERNALSYM SDL_HAT_RIGHTDOWN}
521 {$EXTERNALSYM SDL_HAT_LEFTUP}
523 {$EXTERNALSYM SDL_HAT_LEFTDOWN}
525 // SDL_events.h constants
527 {$EXTERNALSYM SDL_NOEVENT}
529 {$EXTERNALSYM SDL_ACTIVEEVENT}
531 {$EXTERNALSYM SDL_KEYDOWN}
533 {$EXTERNALSYM SDL_KEYUP}
535 {$EXTERNALSYM SDL_MOUSEMOTION}
537 {$EXTERNALSYM SDL_MOUSEBUTTONDOWN}
539 {$EXTERNALSYM SDL_MOUSEBUTTONUP}
541 {$EXTERNALSYM SDL_JOYAXISMOTION}
543 {$EXTERNALSYM SDL_JOYBALLMOTION}
545 {$EXTERNALSYM SDL_JOYHATMOTION}
547 {$EXTERNALSYM SDL_JOYBUTTONDOWN}
549 {$EXTERNALSYM SDL_JOYBUTTONUP}
551 {$EXTERNALSYM SDL_QUIT}
553 {$EXTERNALSYM SDL_SYSWMEVENT}
555 {$EXTERNALSYM SDL_EVENT_RESERVEDA}
557 {$EXTERNALSYM SDL_EVENT_RESERVED}
559 {$EXTERNALSYM SDL_VIDEORESIZE}
561 {$EXTERNALSYM SDL_VIDEOEXPOSE}
563 {$EXTERNALSYM SDL_EVENT_RESERVED2}
565 {$EXTERNALSYM SDL_EVENT_RESERVED3}
567 {$EXTERNALSYM SDL_EVENT_RESERVED4}
569 {$EXTERNALSYM SDL_EVENT_RESERVED5}
571 {$EXTERNALSYM SDL_EVENT_RESERVED6}
573 {$EXTERNALSYM SDL_EVENT_RESERVED7}
574 // Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use
576 {$EXTERNALSYM SDL_USEREVENT}
577 // This last event is only for bounding internal arrays
578 // It is the number of bits in the event mask datatype -- UInt32
580 {$EXTERNALSYM SDL_NUMEVENTS}
583 {$EXTERNALSYM SDL_ALLEVENTS}
586 {$EXTERNALSYM SDL_ACTIVEEVENTMASK}
588 {$EXTERNALSYM SDL_KEYDOWNMASK}
590 {$EXTERNALSYM SDL_KEYUPMASK}
592 {$EXTERNALSYM SDL_MOUSEMOTIONMASK}
594 {$EXTERNALSYM SDL_MOUSEBUTTONDOWNMASK}
596 {$EXTERNALSYM SDL_MOUSEBUTTONUPMASK}
600 {$EXTERNALSYM SDL_MOUSEEVENTMASK}
602 {$EXTERNALSYM SDL_JOYAXISMOTIONMASK}
604 {$EXTERNALSYM SDL_JOYBALLMOTIONMASK}
606 {$EXTERNALSYM SDL_JOYHATMOTIONMASK}
608 {$EXTERNALSYM SDL_JOYBUTTONDOWNMASK}
610 {$EXTERNALSYM SDL_JOYBUTTONUPMASK}
616 {$EXTERNALSYM SDL_JOYEVENTMASK}
618 {$EXTERNALSYM SDL_VIDEORESIZEMASK}
620 {$EXTERNALSYM SDL_QUITMASK}
622 {$EXTERNALSYM SDL_SYSWMEVENTMASK}
624 { This function allows you to set the state of processing certain events.
625 If 'state' is set to SDL_IGNORE, that event will be automatically dropped
626 from the event queue and will not event be filtered.
627 If 'state' is set to SDL_ENABLE, that event will be processed normally.
628 If 'state' is set to SDL_QUERY, SDL_EventState() will return the
629 current processing state of the specified event. }
632 {$EXTERNALSYM SDL_QUERY}
634 {$EXTERNALSYM SDL_IGNORE}
636 {$EXTERNALSYM SDL_DISABLE}
638 {$EXTERNALSYM SDL_ENABLE}
640 //SDL_keyboard.h constants
641 // This is the mask which refers to all hotkey bindings
643 {$EXTERNALSYM SDL_ALL_HOTKEYS}
645 { Enable/Disable keyboard repeat. Keyboard repeat defaults to off.
646 'delay' is the initial delay in ms between the time when a key is
647 pressed, and keyboard repeat begins.
648 'interval' is the time in ms between keyboard repeat events. }
651 {$EXTERNALSYM SDL_DEFAULT_REPEAT_DELAY}
653 {$EXTERNALSYM SDL_DEFAULT_REPEAT_INTERVAL}
655 // The keyboard syms have been cleverly chosen to map to ASCII
657 {$EXTERNALSYM SDLK_UNKNOWN}
659 {$EXTERNALSYM SDLK_FIRST}
661 {$EXTERNALSYM SDLK_BACKSPACE}
663 {$EXTERNALSYM SDLK_TAB}
665 {$EXTERNALSYM SDLK_CLEAR}
667 {$EXTERNALSYM SDLK_RETURN}
669 {$EXTERNALSYM SDLK_PAUSE}
671 {$EXTERNALSYM SDLK_ESCAPE}
673 {$EXTERNALSYM SDLK_SPACE}
675 {$EXTERNALSYM SDLK_EXCLAIM}
677 {$EXTERNALSYM SDLK_QUOTEDBL}
679 {$EXTERNALSYM SDLK_HASH}
681 {$EXTERNALSYM SDLK_DOLLAR}
683 {$EXTERNALSYM SDLK_AMPERSAND}
685 {$EXTERNALSYM SDLK_QUOTE}
687 {$EXTERNALSYM SDLK_LEFTPAREN}
689 {$EXTERNALSYM SDLK_RIGHTPAREN}
691 {$EXTERNALSYM SDLK_ASTERISK}
693 {$EXTERNALSYM SDLK_PLUS}
695 {$EXTERNALSYM SDLK_COMMA}
697 {$EXTERNALSYM SDLK_MINUS}
699 {$EXTERNALSYM SDLK_PERIOD}
701 {$EXTERNALSYM SDLK_SLASH}
703 {$EXTERNALSYM SDLK_0}
705 {$EXTERNALSYM SDLK_1}
707 {$EXTERNALSYM SDLK_2}
709 {$EXTERNALSYM SDLK_3}
711 {$EXTERNALSYM SDLK_4}
713 {$EXTERNALSYM SDLK_5}
715 {$EXTERNALSYM SDLK_6}
717 {$EXTERNALSYM SDLK_7}
719 {$EXTERNALSYM SDLK_8}
721 {$EXTERNALSYM SDLK_9}
723 {$EXTERNALSYM SDLK_COLON}
725 {$EXTERNALSYM SDLK_SEMICOLON}
727 {$EXTERNALSYM SDLK_LESS}
729 {$EXTERNALSYM SDLK_EQUALS}
731 {$EXTERNALSYM SDLK_GREATER}
733 {$EXTERNALSYM SDLK_QUESTION}
735 {$EXTERNALSYM SDLK_AT}
737 { Skip uppercase letters }
740 {$EXTERNALSYM SDLK_LEFTBRACKET}
742 {$EXTERNALSYM SDLK_BACKSLASH}
744 {$EXTERNALSYM SDLK_RIGHTBRACKET}
746 {$EXTERNALSYM SDLK_CARET}
748 {$EXTERNALSYM SDLK_UNDERSCORE}
750 {$EXTERNALSYM SDLK_BACKQUOTE}
752 {$EXTERNALSYM SDLK_a}
754 {$EXTERNALSYM SDLK_b}
756 {$EXTERNALSYM SDLK_c}
758 {$EXTERNALSYM SDLK_d}
760 {$EXTERNALSYM SDLK_e}
762 {$EXTERNALSYM SDLK_f}
764 {$EXTERNALSYM SDLK_g}
766 {$EXTERNALSYM SDLK_h}
768 {$EXTERNALSYM SDLK_i}
770 {$EXTERNALSYM SDLK_j}
772 {$EXTERNALSYM SDLK_k}
774 {$EXTERNALSYM SDLK_l}
776 {$EXTERNALSYM SDLK_m}
778 {$EXTERNALSYM SDLK_n}
780 {$EXTERNALSYM SDLK_o}
782 {$EXTERNALSYM SDLK_p}
784 {$EXTERNALSYM SDLK_q}
786 {$EXTERNALSYM SDLK_r}
788 {$EXTERNALSYM SDLK_s}
790 {$EXTERNALSYM SDLK_t}
792 {$EXTERNALSYM SDLK_u}
794 {$EXTERNALSYM SDLK_v}
796 {$EXTERNALSYM SDLK_w}
798 {$EXTERNALSYM SDLK_x}
800 {$EXTERNALSYM SDLK_y}
802 {$EXTERNALSYM SDLK_z}
804 {$EXTERNALSYM SDLK_DELETE}
805 // End of ASCII mapped keysyms
807 // International keyboard syms
809 {$EXTERNALSYM SDLK_WORLD_0}
811 {$EXTERNALSYM SDLK_WORLD_1}
813 {$EXTERNALSYM SDLK_WORLD_2}
815 {$EXTERNALSYM SDLK_WORLD_3}
817 {$EXTERNALSYM SDLK_WORLD_4}
819 {$EXTERNALSYM SDLK_WORLD_5}
821 {$EXTERNALSYM SDLK_WORLD_6}
823 {$EXTERNALSYM SDLK_WORLD_7}
825 {$EXTERNALSYM SDLK_WORLD_8}
827 {$EXTERNALSYM SDLK_WORLD_9}
829 {$EXTERNALSYM SDLK_WORLD_10}
831 {$EXTERNALSYM SDLK_WORLD_11}
833 {$EXTERNALSYM SDLK_WORLD_12}
835 {$EXTERNALSYM SDLK_WORLD_13}
837 {$EXTERNALSYM SDLK_WORLD_14}
839 {$EXTERNALSYM SDLK_WORLD_15}
841 {$EXTERNALSYM SDLK_WORLD_16}
843 {$EXTERNALSYM SDLK_WORLD_17}
845 {$EXTERNALSYM SDLK_WORLD_18}
847 {$EXTERNALSYM SDLK_WORLD_19}
849 {$EXTERNALSYM SDLK_WORLD_20}
851 {$EXTERNALSYM SDLK_WORLD_21}
853 {$EXTERNALSYM SDLK_WORLD_22}
855 {$EXTERNALSYM SDLK_WORLD_23}
857 {$EXTERNALSYM SDLK_WORLD_24}
859 {$EXTERNALSYM SDLK_WORLD_25}
861 {$EXTERNALSYM SDLK_WORLD_26}
863 {$EXTERNALSYM SDLK_WORLD_27}
865 {$EXTERNALSYM SDLK_WORLD_28}
867 {$EXTERNALSYM SDLK_WORLD_29}
869 {$EXTERNALSYM SDLK_WORLD_30}
871 {$EXTERNALSYM SDLK_WORLD_31}
873 {$EXTERNALSYM SDLK_WORLD_32}
875 {$EXTERNALSYM SDLK_WORLD_33}
877 {$EXTERNALSYM SDLK_WORLD_34}
879 {$EXTERNALSYM SDLK_WORLD_35}
881 {$EXTERNALSYM SDLK_WORLD_36}
883 {$EXTERNALSYM SDLK_WORLD_37}
885 {$EXTERNALSYM SDLK_WORLD_38}
887 {$EXTERNALSYM SDLK_WORLD_39}
889 {$EXTERNALSYM SDLK_WORLD_40}
891 {$EXTERNALSYM SDLK_WORLD_41}
893 {$EXTERNALSYM SDLK_WORLD_42}
895 {$EXTERNALSYM SDLK_WORLD_43}
897 {$EXTERNALSYM SDLK_WORLD_44}
899 {$EXTERNALSYM SDLK_WORLD_45}
901 {$EXTERNALSYM SDLK_WORLD_46}
903 {$EXTERNALSYM SDLK_WORLD_47}
905 {$EXTERNALSYM SDLK_WORLD_48}
907 {$EXTERNALSYM SDLK_WORLD_49}
909 {$EXTERNALSYM SDLK_WORLD_50}
911 {$EXTERNALSYM SDLK_WORLD_51}
913 {$EXTERNALSYM SDLK_WORLD_52}
915 {$EXTERNALSYM SDLK_WORLD_53}
917 {$EXTERNALSYM SDLK_WORLD_54}
919 {$EXTERNALSYM SDLK_WORLD_55}
921 {$EXTERNALSYM SDLK_WORLD_56}
923 {$EXTERNALSYM SDLK_WORLD_57}
925 {$EXTERNALSYM SDLK_WORLD_58}
927 {$EXTERNALSYM SDLK_WORLD_59}
929 {$EXTERNALSYM SDLK_WORLD_60}
931 {$EXTERNALSYM SDLK_WORLD_61}
933 {$EXTERNALSYM SDLK_WORLD_62}
935 {$EXTERNALSYM SDLK_WORLD_63}
937 {$EXTERNALSYM SDLK_WORLD_64}
939 {$EXTERNALSYM SDLK_WORLD_65}
941 {$EXTERNALSYM SDLK_WORLD_66}
943 {$EXTERNALSYM SDLK_WORLD_67}
945 {$EXTERNALSYM SDLK_WORLD_68}
947 {$EXTERNALSYM SDLK_WORLD_69}
949 {$EXTERNALSYM SDLK_WORLD_70}
951 {$EXTERNALSYM SDLK_WORLD_71}
953 {$EXTERNALSYM SDLK_WORLD_72}
955 {$EXTERNALSYM SDLK_WORLD_73}
957 {$EXTERNALSYM SDLK_WORLD_74}
959 {$EXTERNALSYM SDLK_WORLD_75}
961 {$EXTERNALSYM SDLK_WORLD_76}
963 {$EXTERNALSYM SDLK_WORLD_77}
965 {$EXTERNALSYM SDLK_WORLD_78}
967 {$EXTERNALSYM SDLK_WORLD_79}
969 {$EXTERNALSYM SDLK_WORLD_80}
971 {$EXTERNALSYM SDLK_WORLD_81}
973 {$EXTERNALSYM SDLK_WORLD_82}
975 {$EXTERNALSYM SDLK_WORLD_83}
977 {$EXTERNALSYM SDLK_WORLD_84}
979 {$EXTERNALSYM SDLK_WORLD_85}
981 {$EXTERNALSYM SDLK_WORLD_86}
983 {$EXTERNALSYM SDLK_WORLD_87}
985 {$EXTERNALSYM SDLK_WORLD_88}
987 {$EXTERNALSYM SDLK_WORLD_89}
989 {$EXTERNALSYM SDLK_WORLD_90}
991 {$EXTERNALSYM SDLK_WORLD_91}
993 {$EXTERNALSYM SDLK_WORLD_92}
995 {$EXTERNALSYM SDLK_WORLD_93}
997 {$EXTERNALSYM SDLK_WORLD_94}
999 {$EXTERNALSYM SDLK_WORLD_95}
1001 // Numeric keypad
1003 {$EXTERNALSYM SDLK_KP0}
1005 {$EXTERNALSYM SDLK_KP1}
1007 {$EXTERNALSYM SDLK_KP2}
1009 {$EXTERNALSYM SDLK_KP3}
1011 {$EXTERNALSYM SDLK_KP4}
1013 {$EXTERNALSYM SDLK_KP5}
1015 {$EXTERNALSYM SDLK_KP6}
1017 {$EXTERNALSYM SDLK_KP7}
1019 {$EXTERNALSYM SDLK_KP8}
1021 {$EXTERNALSYM SDLK_KP9}
1023 {$EXTERNALSYM SDLK_KP_PERIOD}
1025 {$EXTERNALSYM SDLK_KP_DIVIDE}
1027 {$EXTERNALSYM SDLK_KP_MULTIPLY}
1029 {$EXTERNALSYM SDLK_KP_MINUS}
1031 {$EXTERNALSYM SDLK_KP_PLUS}
1033 {$EXTERNALSYM SDLK_KP_ENTER}
1035 {$EXTERNALSYM SDLK_KP_EQUALS}
1037 // Arrows + Home/End pad
1039 {$EXTERNALSYM SDLK_UP}
1041 {$EXTERNALSYM SDLK_DOWN}
1043 {$EXTERNALSYM SDLK_RIGHT}
1045 {$EXTERNALSYM SDLK_LEFT}
1047 {$EXTERNALSYM SDLK_INSERT}
1049 {$EXTERNALSYM SDLK_HOME}
1051 {$EXTERNALSYM SDLK_END}
1053 {$EXTERNALSYM SDLK_PAGEUP}
1055 {$EXTERNALSYM SDLK_PAGEDOWN}
1057 // Function keys
1059 {$EXTERNALSYM SDLK_F1}
1061 {$EXTERNALSYM SDLK_F2}
1063 {$EXTERNALSYM SDLK_F3}
1065 {$EXTERNALSYM SDLK_F4}
1067 {$EXTERNALSYM SDLK_F5}
1069 {$EXTERNALSYM SDLK_F6}
1071 {$EXTERNALSYM SDLK_F7}
1073 {$EXTERNALSYM SDLK_F8}
1075 {$EXTERNALSYM SDLK_F9}
1077 {$EXTERNALSYM SDLK_F10}
1079 {$EXTERNALSYM SDLK_F11}
1081 {$EXTERNALSYM SDLK_F12}
1083 {$EXTERNALSYM SDLK_F13}
1085 {$EXTERNALSYM SDLK_F14}
1087 {$EXTERNALSYM SDLK_F15}
1089 // Key state modifier keys
1091 {$EXTERNALSYM SDLK_NUMLOCK}
1093 {$EXTERNALSYM SDLK_CAPSLOCK}
1095 {$EXTERNALSYM SDLK_SCROLLOCK}
1097 {$EXTERNALSYM SDLK_RSHIFT}
1099 {$EXTERNALSYM SDLK_LSHIFT}
1101 {$EXTERNALSYM SDLK_RCTRL}
1103 {$EXTERNALSYM SDLK_LCTRL}
1105 {$EXTERNALSYM SDLK_RALT}
1107 {$EXTERNALSYM SDLK_LALT}
1109 {$EXTERNALSYM SDLK_RMETA}
1111 {$EXTERNALSYM SDLK_LMETA}
1113 {$EXTERNALSYM SDLK_LSUPER}
1115 {$EXTERNALSYM SDLK_RSUPER}
1117 {$EXTERNALSYM SDLK_MODE}
1119 {$EXTERNALSYM SDLK_COMPOSE}
1121 // Miscellaneous function keys
1123 {$EXTERNALSYM SDLK_HELP}
1125 {$EXTERNALSYM SDLK_PRINT}
1127 {$EXTERNALSYM SDLK_SYSREQ}
1129 {$EXTERNALSYM SDLK_BREAK}
1131 {$EXTERNALSYM SDLK_MENU}
1133 {$EXTERNALSYM SDLK_POWER}
1135 {$EXTERNALSYM SDLK_EURO}
1137 {$IFDEF GP2X}
1139 {$EXTERNALSYM SDLK_GP2X_UP}
1141 {$EXTERNALSYM SDLK_GP2X_UPLEFT}
1143 {$EXTERNALSYM SDLK_GP2X_LEFT}
1145 {$EXTERNALSYM SDLK_GP2X_DOWNLEFT}
1147 {$EXTERNALSYM SDLK_GP2X_DOWN}
1149 {$EXTERNALSYM SDLK_GP2X_DOWNRIGHT}
1151 {$EXTERNALSYM SDLK_GP2X_RIGHT}
1153 {$EXTERNALSYM SDLK_GP2X_UPRIGHT}
1155 {$EXTERNALSYM SDLK_GP2X_START}
1157 {$EXTERNALSYM SDLK_GP2X_SELECT}
1159 {$EXTERNALSYM SDLK_GP2X_L}
1161 {$EXTERNALSYM SDLK_GP2X_R}
1163 {$EXTERNALSYM SDLK_GP2X_A}
1165 {$EXTERNALSYM SDLK_GP2X_B}
1167 {$EXTERNALSYM SDLK_GP2X_Y}
1169 {$EXTERNALSYM SDLK_GP2X_X}
1171 {$EXTERNALSYM SDLK_GP2X_VOLUP}
1173 {$EXTERNALSYM SDLK_GP2X_VOLDOWN}
1175 {$EXTERNALSYM SDLK_GP2X_CLICK}
1176 {$ENDIF}
1178 // Enumeration of valid key mods (possibly OR'd together)
1180 {$EXTERNALSYM KMOD_NONE}
1182 {$EXTERNALSYM KMOD_LSHIFT}
1184 {$EXTERNALSYM KMOD_RSHIFT}
1186 {$EXTERNALSYM KMOD_LCTRL}
1188 {$EXTERNALSYM KMOD_RCTRL}
1190 {$EXTERNALSYM KMOD_LALT}
1192 {$EXTERNALSYM KMOD_RALT}
1194 {$EXTERNALSYM KMOD_LMETA}
1196 {$EXTERNALSYM KMOD_RMETA}
1198 {$EXTERNALSYM KMOD_NUM}
1200 {$EXTERNALSYM KMOD_CAPS}
1202 {$EXTERNALSYM KMOD_MODE}
1204 {$EXTERNALSYM KMOD_RESERVED}
1207 {$EXTERNALSYM KMOD_CTRL}
1209 {$EXTERNALSYM KMOD_SHIFT}
1211 {$EXTERNALSYM KMOD_ALT}
1213 {$EXTERNALSYM KMOD_META}
1215 //SDL_video.h constants
1216 // Transparency definitions: These define alpha as the opacity of a surface */
1218 {$EXTERNALSYM SDL_ALPHA_OPAQUE}
1220 {$EXTERNALSYM SDL_ALPHA_TRANSPARENT}
1222 // These are the currently supported flags for the SDL_surface
1223 // Available for SDL_CreateRGBSurface() or SDL_SetVideoMode()
1225 {$EXTERNALSYM SDL_SWSURFACE}
1227 {$EXTERNALSYM SDL_HWSURFACE}
1229 {$EXTERNALSYM SDL_ASYNCBLIT}
1230 // Available for SDL_SetVideoMode()
1232 {$EXTERNALSYM SDL_ANYFORMAT}
1234 {$EXTERNALSYM SDL_HWPALETTE}
1236 {$EXTERNALSYM SDL_DOUBLEBUF}
1238 {$EXTERNALSYM SDL_FULLSCREEN}
1240 {$EXTERNALSYM SDL_OPENGL}
1242 {$EXTERNALSYM SDL_OPENGLBLIT}
1244 {$EXTERNALSYM SDL_RESIZABLE}
1246 {$EXTERNALSYM SDL_NOFRAME}
1247 // Used internally (read-only)
1249 {$EXTERNALSYM SDL_HWACCEL}
1251 {$EXTERNALSYM SDL_SRCCOLORKEY}
1253 {$EXTERNALSYM SDL_RLEACCELOK}
1255 {$EXTERNALSYM SDL_RLEACCEL}
1257 {$EXTERNALSYM SDL_SRCALPHA}
1259 {$EXTERNALSYM SDL_SRCCLIPPING}
1261 {$EXTERNALSYM SDL_PREALLOC}
1263 { The most common video overlay formats.
1264 For an explanation of these pixel formats, see:
1265 http://www.webartz.com/fourcc/indexyuv.htm
1267 For information on the relationship between color spaces, see:
1268 http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html }
1271 {$EXTERNALSYM SDL_YV12_OVERLAY}
1273 {$EXTERNALSYM SDL_IYUV_OVERLAY}
1275 {$EXTERNALSYM SDL_YUY2_OVERLAY}
1277 {$EXTERNALSYM SDL_UYVY_OVERLAY}
1279 {$EXTERNALSYM SDL_YVYU_OVERLAY}
1281 // flags for SDL_SetPalette()
1283 {$EXTERNALSYM SDL_LOGPAL}
1285 {$EXTERNALSYM SDL_PHYSPAL}
1287 //SDL_mouse.h constants
1288 { Used as a mask when testing buttons in buttonstate
1289 Button 1: Left mouse button
1290 Button 2: Middle mouse button
1291 Button 3: Right mouse button
1292 Button 4: Mouse Wheel Up
1293 Button 5: Mouse Wheel Down
1294 }
1296 {$EXTERNALSYM SDL_BUTTON_LEFT}
1298 {$EXTERNALSYM SDL_BUTTON_MIDDLE}
1300 {$EXTERNALSYM SDL_BUTTON_RIGHT}
1302 {$EXTERNALSYM SDL_BUTTON_WHEELUP}
1304 {$EXTERNALSYM SDL_BUTTON_WHEELDOWN}
1306 {$EXTERNALSYM SDL_BUTTON_LMASK}
1308 {$EXTERNALSYM SDL_BUTTON_MMASK}
1310 {$EXTERNALSYM SDL_BUTTON_RMask}
1312 // SDL_active.h constants
1313 // The available application states
1315 {$EXTERNALSYM SDL_APPMOUSEFOCUS}
1317 {$EXTERNALSYM SDL_APPINPUTFOCUS}
1319 {$EXTERNALSYM SDL_APPACTIVE}
1321 // SDL_mutex.h constants
1322 // Synchronization functions which can time out return this value
1323 // they time out.
1326 {$EXTERNALSYM SDL_MUTEX_TIMEDOUT}
1328 // This is the timeout value which corresponds to never time out
1330 {$EXTERNALSYM SDL_MUTEX_MAXWAIT}
1332 {TSDL_GrabMode = (
1333 SDL_GRAB_QUERY,
1334 SDL_GRAB_OFF,
1335 SDL_GRAB_ON,
1336 SDL_GRAB_FULLSCREEN ); // Used internally}
1340 //SDL_GRAB_FULLSCREEN // Used internally
1342 type
1344 //SDL_types.h types
1345 // Basic data types
1354 {$EXTERNALSYM UInt8}
1359 {$EXTERNALSYM UInt16}
1363 {$EXTERNALSYM SInt8}
1367 {$EXTERNALSYM SInt16}
1371 {$EXTERNALSYM UInt32}
1374 {$EXTERNALSYM SInt32}
1385 {$EXTERNALSYM UInt64}
1392 {$EXTERNALSYM SInt64}
1396 // SDL_error.h types
1397 TSDL_errorcode = (
1398 SDL_ENOMEM,
1399 SDL_EFREAD,
1400 SDL_EFWRITE,
1401 SDL_EFSEEK,
1402 SDL_LASTERROR);
1405 {$EXTERNALSYM SDL_errorcode}
1410 (* #if 0 means: never
1411 1 : ( value_c : Byte );
1412 *)
1420 { This is a numeric value corresponding to the current error }
1423 { This is a key used to index into a language hashtable containing
1424 internationalized versions of the SDL error messages. If the key
1425 is not in the hashtable, or no hashtable is available, the key is
1426 used directly as an error message format string. }
1429 { These are the arguments for the error functions }
1434 // SDL_rwops.h types
1435 // This is the read/write operation structure -- very basic
1436 // some helper types to handle the unions
1437 // "packed" is only guessed
1441 // FILE * is only defined in Kylix so we use a simple Pointer
1455 // first declare the pointer type
1457 // now the pointer to function types
1458 {$IFNDEF __GPC__}
1460 TRead = function( context: PSDL_RWops; Ptr: Pointer; size: Integer; maxnum : Integer ): Integer; cdecl;
1461 TWrite = function( context: PSDL_RWops; Ptr: Pointer; size: Integer; num: Integer ): Integer; cdecl;
1463 {$ELSE}
1465 TRead = function( context: PSDL_RWops; Ptr: Pointer; size: Integer; maxnum : Integer ): Integer;
1468 {$ENDIF}
1469 // the variant record itself
1475 // a keyword as name is not allowed
1477 // be warned! structure alignment may arise at this point
1485 {$EXTERNALSYM SDL_RWops}
1488 // SDL_timer.h types
1489 // Function prototype for the timer callback function
1490 {$IFNDEF __GPC__}
1492 {$ELSE}
1494 {$ENDIF}
1496 { New timer API, supports multiple timers
1497 Written by Stephane Peter <megastep@lokigames.com> }
1499 { Function prototype for the new timer callback function.
1500 The callback function is passed the current timer interval and returns
1501 the next timer interval. If the returned value is the same as the one
1502 passed in, the periodic alarm continues, otherwise a new alarm is
1503 scheduled. If the callback returns 0, the periodic alarm is cancelled. }
1504 {$IFNDEF __GPC__}
1506 {$ELSE}
1508 {$ENDIF}
1510 // Definition of the timer ID type
1520 {$IFNDEF __GPC__}
1522 {$ELSE}
1524 {$ENDIF}
1526 // SDL_audio.h types
1527 // The calculated values in this structure are calculated by SDL_OpenAudio()
1537 { This function is called when the audio device needs more data.
1538 'stream' is a pointer to the audio data buffer
1539 'len' is the length of that buffer in bytes.
1540 Once the callback returns, the buffer will no longer be valid.
1541 Stereo samples are stored in a LRLRLR ordering.}
1546 // A structure to hold a set of audio conversion filters and buffers
1572 TSDL_Audiostatus = (
1573 SDL_AUDIO_STOPPED,
1574 SDL_AUDIO_PLAYING,
1575 SDL_AUDIO_PAUSED
1576 );
1578 // SDL_cdrom.h types
1579 TSDL_CDStatus = (
1580 CD_ERROR,
1581 CD_TRAYEMPTY,
1582 CD_STOPPED,
1583 CD_PLAYING,
1584 CD_PAUSED );
1595 // This structure is only current as of the last call to SDL_CDStatus()
1601 // The rest of this structure is only valid if there's a CD in drive
1608 //SDL_joystick.h types
1615 // The private structure used to keep track of a joystick
1618 // joystick ID
1620 // values used to translate device-specific coordinates into SDL-standard ranges
1630 // The SDL joystick structure
1653 // SDL_verion.h types
1661 // SDL_keyboard.h types
1674 // SDL_events.h types
1675 {Checks the event queue for messages and optionally returns them.
1676 If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to
1677 the back of the event queue.
1678 If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front
1679 of the event queue, matching 'mask', will be returned and will not
1680 be removed from the queue.
1681 If 'action' is SDL_GETEVENT, up to 'numevents' events at the front
1682 of the event queue, matching 'mask', will be returned and will be
1683 removed from the queue.
1684 This function returns the number of events actually stored, or -1
1685 if there was an error. This function is thread-safe. }
1689 // Application visibility event structure
1696 // Keyboard event structure
1704 // Mouse motion event structure
1714 // Mouse button event structure
1724 // Joystick axis motion event structure
1732 // Joystick trackball motion event structure
1741 // Joystick hat position change event structure
1747 8 1 2
1748 7 0 3
1749 6 5 4
1751 Note that zero means the POV is centered. }
1755 // Joystick button event structure
1763 { The "window resized" event
1764 When you get this event, you are responsible for setting a new video
1765 mode with the new width and height. }
1772 // The "quit requested" event
1778 // A user-defined event type
1787 // The "screen redraw" event
1793 {$IFDEF Unix}
1794 //These are the various supported subsystems under UNIX
1796 {$ENDIF}
1798 // The windows custom event structure
1799 {$IFDEF WINDOWS}
1808 {$ELSE}
1810 {$IFDEF Unix}
1811 { The Linux custom event structure }
1816 {$IFDEF FPC}
1817 {$IFNDEF GP2X}
1819 {$ENDIF}
1820 {$ELSE}
1822 {$ENDIF}
1824 {$ELSE}
1825 { The generic custom event structure }
1831 {$ENDIF}
1833 {$ENDIF}
1835 // The Windows custom window manager information structure
1836 {$IFDEF WINDOWS}
1842 {$ELSE}
1844 // The Linux custom window manager information structure
1845 {$IFDEF Unix}
1846 {$IFNDEF GP2X}
1850 {* These locking functions should be called around
1851 any X11 functions using the display variable.
1852 They lock the event thread, so should not be
1853 called around event functions or from event filters.
1854 *}
1858 // Introduced in SDL 1.0.2
1862 {$ENDIF}
1868 {$IFNDEF GP2X}
1870 {$ENDIF}
1872 {$ELSE}
1873 // The generic custom window manager information structure
1879 {$ENDIF}
1881 {$ENDIF}
1908 { This function sets up a filter to process all events before they
1909 change internal state and are posted to the internal event queue.
1911 The filter is protypted as: }
1912 {$IFNDEF __GPC__}
1914 {$ELSE}
1916 {$ENDIF}
1918 // SDL_video.h types
1919 // Useful data types
1928 {$EXTERNALSYM SDL_Rect}
1947 // Everything in the pixel format structure is read-only
1969 {$IFDEF WINDOWS}
1970 {PPrivate_hwdata = ^TPrivate_hwdata;
1971 TPrivate_hwdata = record
1972 dd_surface : IDIRECTDRAWSURFACE3;
1973 dd_writebuf : IDIRECTDRAWSURFACE3;
1974 end;}
1975 {ELSE}
1976 {$ENDIF}
1978 // The structure passed to the low level blit functions
1995 // typedef for private surface blitting functions
1998 {$IFNDEF __GPC__}
1999 TSDL_Blit = function( src: PSDL_Surface; srcrect: PSDL_Rect; dst: PSDL_Surface; dstrect: PSDL_Rect ): Integer; cdecl;
2000 {$ELSE}
2001 TSDL_Blit = function( src: PSDL_Surface; srcrect: PSDL_Rect; dst: PSDL_Surface; dstrect: PSDL_Rect ): Integer;
2002 {$ENDIF}
2004 // The type definition for the low level blit functions
2005 //TSDL_LoBlit = procedure( info : PSDL_BlitInfo ); cdecl;
2007 // This is the private info structure for software accelerated blits
2008 {PPrivate_swaccel = ^TPrivate_swaccel;
2009 TPrivate_swaccel = record
2010 blit : TSDL_LoBlit;
2011 aux_data : Pointer;
2012 end;}
2014 // Blit mapping definition
2015 {PSDL_BlitMap = ^TSDL_BlitMap;
2016 TSDL_BlitMap = record
2017 dst : PSDL_Surface;
2018 identity : Integer;
2019 table : PUInt8;
2020 hw_blit : TSDL_Blit;
2021 sw_blit : TSDL_Blit;
2022 hw_data : PPrivate_hwaccel;
2023 sw_data : PPrivate_swaccel;
2025 // the version count matches the destination; mismatch indicates an invalid mapping
2026 format_version : Cardinal;
2027 end;}
2038 // clipping information:
2041 // Allow recursive locks
2043 // info for fast blit mapping to other surfaces
2045 // format version, bumped at every change to invalidate blit maps
2050 // Useful for determining the video hardware capabilities
2054 {hw_available: 1; // Can you create hardware surfaces
2055 wm_available: 1; // Can you talk to a window manager?
2056 UnusedBits1: 6;}
2058 {UnusedBits2: 1;
2059 blit_hw: 1; // Flag:UInt32 Accelerated blits HW --> HW
2060 blit_hw_CC: 1; // Flag:UInt32 Accelerated blits with Colorkey
2061 blit_hw_A: 1; // Flag:UInt32 Accelerated blits with Alpha
2062 blit_sw: 1; // Flag:UInt32 Accelerated blits SW --> HW
2063 blit_sw_CC: 1; // Flag:UInt32 Accelerated blits with Colorkey
2064 blit_sw_A: 1; // Flag:UInt32 Accelerated blits with Alpha
2065 blit_fill: 1; // Flag:UInt32 Accelerated color fill}
2073 // The YUV hardware video overlay
2080 // An array of pitches, one for each plane. Pitch is the length of a row in bytes.
2082 // An array of pointers to the data of each plane. The overlay should be locked before these pointers are used.
2084 // This will be set to 1 if the overlay is hardware accelerated.
2087 // Public enumeration for setting the OpenGL window attributes.
2088 TSDL_GLAttr = (
2089 SDL_GL_RED_SIZE,
2090 SDL_GL_GREEN_SIZE,
2091 SDL_GL_BLUE_SIZE,
2092 SDL_GL_ALPHA_SIZE,
2093 SDL_GL_BUFFER_SIZE,
2094 SDL_GL_DOUBLEBUFFER,
2095 SDL_GL_DEPTH_SIZE,
2096 SDL_GL_STENCIL_SIZE,
2097 SDL_GL_ACCUM_RED_SIZE,
2098 SDL_GL_ACCUM_GREEN_SIZE,
2099 SDL_GL_ACCUM_BLUE_SIZE,
2100 SDL_GL_ACCUM_ALPHA_SIZE,
2101 SDL_GL_STEREO,
2102 SDL_GL_MULTISAMPLEBUFFERS,
2103 SDL_GL_MULTISAMPLESAMPLES,
2104 SDL_GL_ACCELERATED_VISUAL,
2105 SDL_GL_SWAP_CONTROL);
2119 // SDL_mutex.h types
2121 {$IFDEF WINDOWS}
2126 {$ENDIF}
2128 {$IFDEF Unix}
2132 {$IFDEF PTHREAD_NO_RECURSIVE_MUTEX}
2135 {$ENDIF}
2137 {$ENDIF}
2139 {$IFDEF NDS}
2146 {$ENDIF}
2148 {$IFDEF MORPHOS}
2151 {$WARNING FIXME!!}
2154 {$ENDIF}
2156 {$IFDEF __MACH__}
2157 {$define USE_NAMED_SEMAPHORES}
2158 // Broken sem_getvalue() in MacOS X Public Beta */
2159 {$define BROKEN_SEMGETVALUE}
2160 {$ENDIF}
2163 {$IFDEF WINDOWS}
2164 // WINDOWS or Machintosh
2169 {$ELSE}
2170 {$IFDEF FPC}
2171 // This should be semaphore.h
2182 {$ENDIF}
2186 {$IFNDEF USE_NAMED_SEMAPHORES}
2188 {$ENDIF}
2190 {$IFDEF BROKEN_SEMGETVALUE}
2191 { This is a little hack for MacOS X -
2192 It's not thread-safe, but it's better than nothing }
2194 {$ENDIF}
2196 {$ENDIF}
2203 {$IFDEF Unix}
2205 {$ELSE}
2206 // Generic Cond structure
2212 {$ENDIF}
2215 // SDL_thread.h types
2216 {$IFDEF WINDOWS}
2218 {$ENDIF}
2220 {$IFDEF Unix}
2222 {$ENDIF}
2224 {$IFDEF NDS}
2226 {$ENDIF}
2228 {$IFDEF MORPHOS}
2230 {$ENDIF}
2232 { This is the system-independent thread info structure }
2242 // Helper Types
2244 // Keyboard State Array ( See demos for how to use )
2248 // Types required so we don't need to use Windows.pas
2254 // General arrays
2262 {$IFDEF HAS_TYPES}
2264 {$ELSE}
2265 {$IFDEF WINDOWS}
2266 {$IFDEF __GPC__}
2268 {$ELSE}
2270 {$ENDIF}
2271 {$ELSE}
2272 //Can't define TPoint : neither Types nor Windows unit available.
2273 {$ENDIF}
2274 {$ENDIF}
2277 {$IFDEF HAS_TYPES}
2279 {$ELSE}
2280 {$IFDEF WINDOWS}
2281 {$IFDEF __GPC__}
2283 {$ELSE}
2285 {$ENDIF}
2286 {$ELSE}
2287 //Can't define TRect: neither Types nor Windows unit available.
2288 {$ENDIF}
2289 {$ENDIF}
2291 { Generic procedure pointer }
2294 {------------------------------------------------------------------------------}
2295 { initialization }
2296 {------------------------------------------------------------------------------}
2298 { This function loads the SDL dynamically linked library and initializes
2299 the subsystems specified by 'flags' (and those satisfying dependencies)
2300 Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
2301 signal handlers for some commonly ignored fatal signals (like SIGSEGV) }
2303 {$IFDEF MORPHOS}
2304 {$I powersdl.inc}
2305 {$ELSE}
2307 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_Init'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2308 {$EXTERNALSYM SDL_Init}
2310 // This function initializes specific SDL subsystems
2312 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_InitSubSystem'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2313 {$EXTERNALSYM SDL_InitSubSystem}
2315 // This function cleans up specific SDL subsystems
2317 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_QuitSubSystem'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2318 {$EXTERNALSYM SDL_QuitSubSystem}
2320 { This function returns mask of the specified subsystems which have
2321 been initialized.
2322 If 'flags' is 0, it returns a mask of all initialized subsystems. }
2325 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_WasInit'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2326 {$EXTERNALSYM SDL_WasInit}
2328 { This function cleans up all initialized subsystems and unloads the
2329 dynamically linked library. You should call it upon all exit conditions. }
2331 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_Quit'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2332 {$EXTERNALSYM SDL_Quit}
2334 {$IFDEF WINDOWS}
2335 // This should be called from your WinMain() function, if any
2337 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_RegisterApp'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2338 {$EXTERNALSYM SDL_RegisterApp}
2339 {$ENDIF}
2341 {$IFDEF __MACH__}
2342 // This should be called from your main() function, if any
2344 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_InitQuickDraw'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2345 {$EXTERNALSYM SDL_InitQuickDraw}
2346 {$ENDIF}
2349 {------------------------------------------------------------------------------}
2350 { types }
2351 {------------------------------------------------------------------------------}
2352 // The number of elements in a table
2354 {$EXTERNALSYM SDL_TABLESIZE}
2357 {------------------------------------------------------------------------------}
2358 { error-handling }
2359 {------------------------------------------------------------------------------}
2360 // Public functions
2362 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GetError'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2363 {$EXTERNALSYM SDL_GetError}
2365 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_SetError'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2366 {$EXTERNALSYM SDL_SetError}
2368 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_ClearError'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2369 {$EXTERNALSYM SDL_ClearError}
2371 {$IFNDEF WINDOWS}
2373 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_Error'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2374 {$EXTERNALSYM SDL_Error}
2375 {$ENDIF}
2377 // Private error message function - used internally
2380 {------------------------------------------------------------------------------}
2381 { io handling }
2382 {------------------------------------------------------------------------------}
2383 // Functions to create SDL_RWops structures from various data sources
2386 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_RWFromFile'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2387 {$EXTERNALSYM SDL_RWFromFile}
2389 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_FreeRW'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2390 {$EXTERNALSYM SDL_FreeRW}
2392 //fp is FILE *fp ???
2394 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_RWFromFP'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2395 {$EXTERNALSYM SDL_RWFromFP}
2397 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_RWFromMem'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2398 {$EXTERNALSYM SDL_RWFromMem}
2400 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_RWFromConstMem'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2401 {$EXTERNALSYM SDL_RWFromConstMem}
2403 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_AllocRW'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2404 {$EXTERNALSYM SDL_AllocRW}
2407 {$EXTERNALSYM SDL_RWSeek}
2409 {$EXTERNALSYM SDL_RWTell}
2411 {$EXTERNALSYM SDL_RWRead}
2413 {$EXTERNALSYM SDL_RWWrite}
2415 {$EXTERNALSYM SDL_RWClose}
2417 {------------------------------------------------------------------------------}
2418 { time-handling }
2419 {------------------------------------------------------------------------------}
2421 { Get the number of milliseconds since the SDL library initialization. }
2422 { Note that this value wraps if the program runs for more than ~49 days. }
2424 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GetTicks'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2425 {$EXTERNALSYM SDL_GetTicks}
2427 // Wait a specified number of milliseconds before returning
2429 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_Delay'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2430 {$EXTERNALSYM SDL_Delay}
2432 { Add a new timer to the pool of timers already running. }
2433 { Returns a timer ID, or NULL when an error occurs. }
2434 function SDL_AddTimer(interval: UInt32; callback: TSDL_NewTimerCallback; param : Pointer): PSDL_TimerID;
2435 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_AddTimer'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2436 {$EXTERNALSYM SDL_AddTimer}
2438 { Remove one of the multiple timers knowing its ID. }
2439 { Returns a boolean value indicating success. }
2441 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_RemoveTimer'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2442 {$EXTERNALSYM SDL_RemoveTimer}
2445 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_SetTimer'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2446 {$EXTERNALSYM SDL_SetTimer}
2448 {------------------------------------------------------------------------------}
2449 { audio-routines }
2450 {------------------------------------------------------------------------------}
2452 { These functions are used internally, and should not be used unless you
2453 have a specific need to specify the audio driver you want to use.
2454 You should normally use SDL_Init() or SDL_InitSubSystem(). }
2457 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_AudioInit'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2458 {$EXTERNALSYM SDL_AudioInit}
2460 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_AudioQuit'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2461 {$EXTERNALSYM SDL_AudioQuit}
2463 { This function fills the given character buffer with the name of the
2464 current audio driver, and returns a Pointer to it if the audio driver has
2465 been initialized. It returns NULL if no driver has been initialized. }
2468 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_AudioDriverName'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2469 {$EXTERNALSYM SDL_AudioDriverName}
2471 { This function opens the audio device with the desired parameters, and
2472 returns 0 if successful, placing the actual hardware parameters in the
2473 structure pointed to by 'obtained'. If 'obtained' is NULL, the audio
2474 data passed to the callback function will be guaranteed to be in the
2475 requested format, and will be automatically converted to the hardware
2476 audio format if necessary. This function returns -1 if it failed
2477 to open the audio device, or couldn't set up the audio thread.
2479 When filling in the desired audio spec structure,
2480 'desired->freq' should be the desired audio frequency in samples-per-second.
2481 'desired->format' should be the desired audio format.
2482 'desired->samples' is the desired size of the audio buffer, in samples.
2483 This number should be a power of two, and may be adjusted by the audio
2484 driver to a value more suitable for the hardware. Good values seem to
2485 range between 512 and 8096 inclusive, depending on the application and
2486 CPU speed. Smaller values yield faster response time, but can lead
2487 to underflow if the application is doing heavy processing and cannot
2488 fill the audio buffer in time. A stereo sample consists of both right
2489 and left channels in LR ordering.
2490 Note that the number of samples is directly related to time by the
2491 following formula: ms = (samples*1000)/freq
2492 'desired->size' is the size in bytes of the audio buffer, and is
2493 calculated by SDL_OpenAudio().
2494 'desired->silence' is the value used to set the buffer to silence,
2495 and is calculated by SDL_OpenAudio().
2496 'desired->callback' should be set to a function that will be called
2497 when the audio device is ready for more data. It is passed a pointer
2498 to the audio buffer, and the length in bytes of the audio buffer.
2499 This function usually runs in a separate thread, and so you should
2500 protect data structures that it accesses by calling SDL_LockAudio()
2501 and SDL_UnlockAudio() in your code.
2502 'desired->userdata' is passed as the first parameter to your callback
2503 function.
2505 The audio device starts out playing silence when it's opened, and should
2506 be enabled for playing by calling SDL_PauseAudio(0) when you are ready
2507 for your audio callback function to be called. Since the audio driver
2508 may modify the requested size of the audio buffer, you should allocate
2509 any local mixing buffers after you open the audio device. }
2512 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_OpenAudio'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2513 {$EXTERNALSYM SDL_OpenAudio}
2515 { Get the current audio state: }
2517 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GetAudioStatus'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2518 {$EXTERNALSYM SDL_GetAudioStatus}
2520 { This function pauses and unpauses the audio callback processing.
2521 It should be called with a parameter of 0 after opening the audio
2522 device to start playing sound. This is so you can safely initialize
2523 data for your callback function after opening the audio device.
2524 Silence will be written to the audio device during the pause. }
2527 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_PauseAudio'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2528 {$EXTERNALSYM SDL_PauseAudio}
2530 { This function loads a WAVE from the data source, automatically freeing
2531 that source if 'freesrc' is non-zero. For example, to load a WAVE file,
2532 you could do:
2533 SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...);
2535 If this function succeeds, it returns the given SDL_AudioSpec,
2536 filled with the audio data format of the wave data, and sets
2537 'audio_buf' to a malloc()'d buffer containing the audio data,
2538 and sets 'audio_len' to the length of that audio buffer, in bytes.
2539 You need to free the audio buffer with SDL_FreeWAV() when you are
2540 done with it.
2542 This function returns NULL and sets the SDL error message if the
2543 wave file cannot be opened, uses an unknown data format, or is
2544 corrupt. Currently raw and MS-ADPCM WAVE files are supported. }
2548 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_LoadWAV_RW'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2549 {$EXTERNALSYM SDL_LoadWAV_RW}
2551 // Compatibility convenience function -- loads a WAV from a file
2554 {$EXTERNALSYM SDL_LoadWAV}
2556 { This function frees data previously allocated with SDL_LoadWAV_RW() }
2559 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_FreeWAV'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2560 {$EXTERNALSYM SDL_FreeWAV}
2562 { This function takes a source format and rate and a destination format
2563 and rate, and initializes the 'cvt' structure with information needed
2564 by SDL_ConvertAudio() to convert a buffer of audio data from one format
2565 to the other.
2566 This function returns 0, or -1 if there was an error. }
2570 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_BuildAudioCVT'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2571 {$EXTERNALSYM SDL_BuildAudioCVT}
2573 { Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(),
2574 created an audio buffer cvt->buf, and filled it with cvt->len bytes of
2575 audio data in the source format, this function will convert it in-place
2576 to the desired format.
2577 The data conversion may expand the size of the audio data, so the buffer
2578 cvt->buf should be allocated after the cvt structure is initialized by
2579 SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long. }
2581 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_ConvertAudio'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2582 {$EXTERNALSYM SDL_ConvertAudio}
2584 { This takes two audio buffers of the playing audio format and mixes
2585 them, performing addition, volume adjustment, and overflow clipping.
2586 The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME
2587 for full audio volume. Note this does not change hardware volume.
2588 This is provided for convenience -- you can mix your own audio data. }
2591 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_MixAudio'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2592 {$EXTERNALSYM SDL_MixAudio}
2594 { The lock manipulated by these functions protects the callback function.
2595 During a LockAudio/UnlockAudio pair, you can be guaranteed that the
2596 callback function is not running. Do not call these from the callback
2597 function or you will cause deadlock. }
2599 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_LockAudio'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2600 {$EXTERNALSYM SDL_LockAudio}
2602 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_UnlockAudio'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2603 {$EXTERNALSYM SDL_UnlockAudio}
2605 { This function shuts down audio processing and closes the audio device. }
2608 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CloseAudio'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2609 {$EXTERNALSYM SDL_CloseAudio}
2611 {------------------------------------------------------------------------------}
2612 { CD-routines }
2613 {------------------------------------------------------------------------------}
2615 { Returns the number of CD-ROM drives on the system, or -1 if
2616 SDL_Init() has not been called with the SDL_INIT_CDROM flag. }
2619 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CDNumDrives'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2620 {$EXTERNALSYM SDL_CDNumDrives}
2622 { Returns a human-readable, system-dependent identifier for the CD-ROM.
2623 Example:
2624 "/dev/cdrom"
2625 "E:"
2626 "/dev/disk/ide/1/master" }
2629 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CDName'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2630 {$EXTERNALSYM SDL_CDName}
2632 { Opens a CD-ROM drive for access. It returns a drive handle on success,
2633 or NULL if the drive was invalid or busy. This newly opened CD-ROM
2634 becomes the default CD used when other CD functions are passed a NULL
2635 CD-ROM handle.
2636 Drives are numbered starting with 0. Drive 0 is the system default CD-ROM. }
2639 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CDOpen'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2640 {$EXTERNALSYM SDL_CDOpen}
2642 { This function returns the current status of the given drive.
2643 If the drive has a CD in it, the table of contents of the CD and current
2644 play position of the CD will be stored in the SDL_CD structure. }
2647 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CDStatus'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2648 {$EXTERNALSYM SDL_CDStatus}
2650 { Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks'
2651 tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play
2652 until the end of the CD. This function will skip data tracks.
2653 This function should only be called after calling SDL_CDStatus() to
2654 get track information about the CD.
2656 For example:
2657 // Play entire CD:
2658 if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) then
2659 SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
2660 // Play last track:
2661 if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) then
2662 begin
2663 SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0);
2664 end;
2666 // Play first and second track and 10 seconds of third track:
2667 if ( CD_INDRIVE(SDL_CDStatus(cdrom)) )
2668 SDL_CDPlayTracks(cdrom, 0, 0, 2, 10);
2670 This function returns 0, or -1 if there was an error. }
2674 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CDPlayTracks'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2675 {$EXTERNALSYM SDL_CDPlayTracks}
2678 { Play the given CD starting at 'start' frame for 'length' frames.
2679 It returns 0, or -1 if there was an error. }
2682 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CDPlay'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2683 {$EXTERNALSYM SDL_CDPlay}
2685 // Pause play -- returns 0, or -1 on error
2687 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CDPause'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2688 {$EXTERNALSYM SDL_CDPause}
2690 // Resume play -- returns 0, or -1 on error
2692 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CDResume'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2693 {$EXTERNALSYM SDL_CDResume}
2695 // Stop play -- returns 0, or -1 on error
2697 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CDStop'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2698 {$EXTERNALSYM SDL_CDStop}
2700 // Eject CD-ROM -- returns 0, or -1 on error
2702 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CDEject'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2703 {$EXTERNALSYM SDL_CDEject}
2705 // Closes the handle for the CD-ROM drive
2707 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CDClose'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2708 {$EXTERNALSYM SDL_CDClose}
2710 // Given a status, returns true if there's a disk in the drive
2712 {$EXTERNALSYM SDL_CDInDrive}
2714 // Conversion functions from frames to Minute/Second/Frames and vice versa
2717 {$EXTERNALSYM FRAMES_TO_MSF}
2719 {$EXTERNALSYM MSF_TO_FRAMES}
2721 {------------------------------------------------------------------------------}
2722 { JoyStick-routines }
2723 {------------------------------------------------------------------------------}
2725 { Count the number of joysticks attached to the system }
2727 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_NumJoysticks'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2728 {$EXTERNALSYM SDL_NumJoysticks}
2730 { Get the implementation dependent name of a joystick.
2731 This can be called before any joysticks are opened.
2732 If no name can be found, this function returns NULL. }
2734 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_JoystickName'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2735 {$EXTERNALSYM SDL_JoystickName}
2737 { Open a joystick for use - the index passed as an argument refers to
2738 the N'th joystick on the system. This index is the value which will
2739 identify this joystick in future joystick events.
2741 This function returns a joystick identifier, or NULL if an error occurred. }
2743 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_JoystickOpen'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2744 {$EXTERNALSYM SDL_JoystickOpen}
2746 { Returns 1 if the joystick has been opened, or 0 if it has not. }
2748 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_JoystickOpened'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2749 {$EXTERNALSYM SDL_JoystickOpened}
2751 { Get the device index of an opened joystick. }
2753 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_JoystickIndex'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2754 {$EXTERNALSYM SDL_JoystickIndex}
2756 { Get the number of general axis controls on a joystick }
2758 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_JoystickNumAxes'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2759 {$EXTERNALSYM SDL_JoystickNumAxes}
2761 { Get the number of trackballs on a joystick
2762 Joystick trackballs have only relative motion events associated
2763 with them and their state cannot be polled. }
2765 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_JoystickNumBalls'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2766 {$EXTERNALSYM SDL_JoystickNumBalls}
2769 { Get the number of POV hats on a joystick }
2771 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_JoystickNumHats'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2772 {$EXTERNALSYM SDL_JoystickNumHats}
2774 { Get the number of buttons on a joystick }
2776 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_JoystickNumButtons'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2777 {$EXTERNALSYM SDL_JoystickNumButtons}
2779 { Update the current state of the open joysticks.
2780 This is called automatically by the event loop if any joystick
2781 events are enabled. }
2784 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_JoystickUpdate'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2785 {$EXTERNALSYM SDL_JoystickUpdate;}
2787 { Enable/disable joystick event polling.
2788 If joystick events are disabled, you must call SDL_JoystickUpdate()
2789 yourself and check the state of the joystick when you want joystick
2790 information.
2791 The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE. }
2794 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_JoystickEventState'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2795 {$EXTERNALSYM SDL_JoystickEventState}
2797 { Get the current state of an axis control on a joystick
2798 The state is a value ranging from -32768 to 32767.
2799 The axis indices start at index 0. }
2802 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_JoystickGetAxis'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2803 {$EXTERNALSYM SDL_JoystickGetAxis}
2805 { The hat indices start at index 0. }
2808 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_JoystickGetHat'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2809 {$EXTERNALSYM SDL_JoystickGetHat}
2811 { Get the ball axis change since the last poll
2812 This returns 0, or -1 if you passed it invalid parameters.
2813 The ball indices start at index 0. }
2815 function SDL_JoystickGetBall(joystick: PSDL_Joystick; ball: Integer; var dx: Integer; var dy: Integer): Integer;
2816 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_JoystickGetBall'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2817 {$EXTERNALSYM SDL_JoystickGetBall}
2819 { Get the current state of a button on a joystick
2820 The button indices start at index 0. }
2822 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_JoystickGetButton'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2823 {$EXTERNALSYM SDL_JoystickGetButton}
2825 { Close a joystick previously opened with SDL_JoystickOpen() }
2827 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_JoystickClose'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2828 {$EXTERNALSYM SDL_JoystickClose}
2830 {------------------------------------------------------------------------------}
2831 { event-handling }
2832 {------------------------------------------------------------------------------}
2834 { Pumps the event loop, gathering events from the input devices.
2835 This function updates the event queue and internal input device state.
2836 This should only be run in the thread that sets the video mode. }
2839 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_PumpEvents'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2840 {$EXTERNALSYM SDL_PumpEvents;}
2842 { Checks the event queue for messages and optionally returns them.
2843 If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to
2844 the back of the event queue.
2845 If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front
2846 of the event queue, matching 'mask', will be returned and will not
2847 be removed from the queue.
2848 If 'action' is SDL_GETEVENT, up to 'numevents' events at the front
2849 of the event queue, matching 'mask', will be returned and will be
2850 removed from the queue.
2851 This function returns the number of events actually stored, or -1
2852 if there was an error. This function is thread-safe. }
2854 function SDL_PeepEvents(events: PSDL_Event; numevents: Integer; action: TSDL_eventaction; mask: UInt32): Integer;
2855 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_PeepEvents'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2856 {$EXTERNALSYM SDL_PeepEvents}
2858 { Polls for currently pending events, and returns 1 if there are any pending
2859 events, or 0 if there are none available. If 'event' is not NULL, the next
2860 event is removed from the queue and stored in that area. }
2863 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_PollEvent'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2864 {$EXTERNALSYM SDL_PollEvent}
2866 { Waits indefinitely for the next available event, returning 1, or 0 if there
2867 was an error while waiting for events. If 'event' is not NULL, the next
2868 event is removed from the queue and stored in that area. }
2871 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_WaitEvent'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2872 {$EXTERNALSYM SDL_WaitEvent}
2875 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_PushEvent'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2876 {$EXTERNALSYM SDL_PushEvent}
2878 { If the filter returns 1, then the event will be added to the internal queue.
2879 If it returns 0, then the event will be dropped from the queue, but the
2880 internal state will still be updated. This allows selective filtering of
2881 dynamically arriving events.
2883 WARNING: Be very careful of what you do in the event filter function, as
2884 it may run in a different thread!
2886 There is one caveat when dealing with the SDL_QUITEVENT event type. The
2887 event filter is only called when the window manager desires to close the
2888 application window. If the event filter returns 1, then the window will
2889 be closed, otherwise the window will remain open if possible.
2890 If the quit event is generated by an interrupt signal, it will bypass the
2891 internal queue and be delivered to the application at the next event poll. }
2893 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_SetEventFilter'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2894 {$EXTERNALSYM SDL_SetEventFilter}
2896 { Return the current event filter - can be used to "chain" filters.
2897 If there is no event filter set, this function returns NULL. }
2900 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GetEventFilter'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2901 {$EXTERNALSYM SDL_GetEventFilter}
2903 { This function allows you to set the state of processing certain events.
2904 If 'state' is set to SDL_IGNORE, that event will be automatically dropped
2905 from the event queue and will not event be filtered.
2906 If 'state' is set to SDL_ENABLE, that event will be processed normally.
2907 If 'state' is set to SDL_QUERY, SDL_EventState() will return the
2908 current processing state of the specified event. }
2911 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_EventState'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2912 {$EXTERNALSYM SDL_EventState}
2914 {------------------------------------------------------------------------------}
2915 { Version Routines }
2916 {------------------------------------------------------------------------------}
2918 { This macro can be used to fill a version structure with the compile-time
2919 version of the SDL library. }
2921 {$EXTERNALSYM SDL_VERSION}
2923 { This macro turns the version numbers into a numeric value:
2924 (1,2,3) -> (1203)
2925 This assumes that there will never be more than 100 patchlevels }
2928 {$EXTERNALSYM SDL_VERSIONNUM}
2930 // This is the version number macro for the current SDL version
2932 {$EXTERNALSYM SDL_COMPILEDVERSION}
2934 // This macro will evaluate to true if compiled with SDL at least X.Y.Z
2936 {$EXTERNALSYM SDL_VERSION_ATLEAST}
2938 { This function gets the version of the dynamically linked SDL library.
2939 it should NOT be used to fill a version structure, instead you should
2940 use the SDL_Version() macro. }
2943 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_Linked_Version'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2944 {$EXTERNALSYM SDL_Linked_Version}
2946 {------------------------------------------------------------------------------}
2947 { video }
2948 {------------------------------------------------------------------------------}
2950 { These functions are used internally, and should not be used unless you
2951 have a specific need to specify the video driver you want to use.
2952 You should normally use SDL_Init() or SDL_InitSubSystem().
2954 SDL_VideoInit() initializes the video subsystem -- sets up a connection
2955 to the window manager, etc, and determines the current video mode and
2956 pixel format, but does not initialize a window or graphics mode.
2957 Note that event handling is activated by this routine.
2959 If you use both sound and video in your application, you need to call
2960 SDL_Init() before opening the sound device, otherwise under Win32 DirectX,
2961 you won't be able to set full-screen display modes. }
2964 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_VideoInit'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2965 {$EXTERNALSYM SDL_VideoInit}
2967 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_VideoQuit'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2968 {$EXTERNALSYM SDL_VideoQuit}
2970 { This function fills the given character buffer with the name of the
2971 video driver, and returns a pointer to it if the video driver has
2972 been initialized. It returns NULL if no driver has been initialized. }
2975 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_VideoDriverName'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2976 {$EXTERNALSYM SDL_VideoDriverName}
2978 { This function returns a pointer to the current display surface.
2979 If SDL is doing format conversion on the display surface, this
2980 function returns the publicly visible surface, not the real video
2981 surface. }
2984 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GetVideoSurface'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2985 {$EXTERNALSYM SDL_GetVideoSurface}
2987 { This function returns a read-only pointer to information about the
2988 video hardware. If this is called before SDL_SetVideoMode(), the 'vfmt'
2989 member of the returned structure will contain the pixel format of the
2990 "best" video mode. }
2992 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GetVideoInfo'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
2993 {$EXTERNALSYM SDL_GetVideoInfo}
2995 { Check to see if a particular video mode is supported.
2996 It returns 0 if the requested mode is not supported under any bit depth,
2997 or returns the bits-per-pixel of the closest available mode with the
2998 given width and height. If this bits-per-pixel is different from the
2999 one used when setting the video mode, SDL_SetVideoMode() will succeed,
3000 but will emulate the requested bits-per-pixel with a shadow surface.
3002 The arguments to SDL_VideoModeOK() are the same ones you would pass to
3003 SDL_SetVideoMode() }
3006 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_VideoModeOK'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3007 {$EXTERNALSYM SDL_VideoModeOK}
3009 { Return a pointer to an array of available screen dimensions for the
3010 given format and video flags, sorted largest to smallest. Returns
3011 NULL if there are no dimensions available for a particular format,
3012 or (SDL_Rect **)-1 if any dimension is okay for the given format.
3014 if 'format' is NULL, the mode list will be for the format given
3015 by SDL_GetVideoInfo( ) - > vfmt }
3018 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_ListModes'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3019 {$EXTERNALSYM SDL_ListModes}
3022 { Set up a video mode with the specified width, height and bits-per-pixel.
3024 If 'bpp' is 0, it is treated as the current display bits per pixel.
3026 If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the
3027 requested bits-per-pixel, but will return whatever video pixel format is
3028 available. The default is to emulate the requested pixel format if it
3029 is not natively available.
3031 If SDL_HWSURFACE is set in 'flags', the video surface will be placed in
3032 video memory, if possible, and you may have to call SDL_LockSurface()
3033 in order to access the raw framebuffer. Otherwise, the video surface
3034 will be created in system memory.
3036 If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle
3037 updates asynchronously, but you must always lock before accessing pixels.
3038 SDL will wait for updates to complete before returning from the lock.
3040 If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee
3041 that the colors set by SDL_SetColors() will be the colors you get.
3042 Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all
3043 of the colors exactly the way they are requested, and you should look
3044 at the video surface structure to determine the actual palette.
3045 If SDL cannot guarantee that the colors you request can be set,
3046 i.e. if the colormap is shared, then the video surface may be created
3047 under emulation in system memory, overriding the SDL_HWSURFACE flag.
3049 If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set
3050 a fullscreen video mode. The default is to create a windowed mode
3051 if the current graphics system has a window manager.
3052 If the SDL library is able to set a fullscreen video mode, this flag
3053 will be set in the surface that is returned.
3055 If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up
3056 two surfaces in video memory and swap between them when you call
3057 SDL_Flip(). This is usually slower than the normal single-buffering
3058 scheme, but prevents "tearing" artifacts caused by modifying video
3059 memory while the monitor is refreshing. It should only be used by
3060 applications that redraw the entire screen on every update.
3062 This function returns the video framebuffer surface, or NULL if it fails. }
3065 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_SetVideoMode'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3066 {$EXTERNALSYM SDL_SetVideoMode}
3069 { Makes sure the given list of rectangles is updated on the given screen.
3070 If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire
3071 screen.
3072 These functions should not be called while 'screen' is locked. }
3075 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_UpdateRects'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3076 {$EXTERNALSYM SDL_UpdateRects}
3078 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_UpdateRect'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3079 {$EXTERNALSYM SDL_UpdateRect}
3082 { On hardware that supports double-buffering, this function sets up a flip
3083 and returns. The hardware will wait for vertical retrace, and then swap
3084 video buffers before the next video surface blit or lock will return.
3085 On hardware that doesn not support double-buffering, this is equivalent
3086 to calling SDL_UpdateRect(screen, 0, 0, 0, 0);
3087 The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when
3088 setting the video mode for this function to perform hardware flipping.
3089 This function returns 0 if successful, or -1 if there was an error.}
3092 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_Flip'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3093 {$EXTERNALSYM SDL_Flip}
3095 { Set the gamma correction for each of the color channels.
3096 The gamma values range (approximately) between 0.1 and 10.0
3098 If this function isn't supported directly by the hardware, it will
3099 be emulated using gamma ramps, if available. If successful, this
3100 function returns 0, otherwise it returns -1. }
3103 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_SetGamma'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3104 {$EXTERNALSYM SDL_SetGamma}
3106 { Set the gamma translation table for the red, green, and blue channels
3107 of the video hardware. Each table is an array of 256 16-bit quantities,
3108 representing a mapping between the input and output for that channel.
3109 The input is the index into the array, and the output is the 16-bit
3110 gamma value at that index, scaled to the output color precision.
3112 You may pass NULL for any of the channels to leave it unchanged.
3113 If the call succeeds, it will return 0. If the display driver or
3114 hardware does not support gamma translation, or otherwise fails,
3115 this function will return -1. }
3117 function SDL_SetGammaRamp( redtable: PUInt16; greentable: PUInt16; bluetable: PUInt16): Integer;
3118 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_SetGammaRamp'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3119 {$EXTERNALSYM SDL_SetGammaRamp}
3121 { Retrieve the current values of the gamma translation tables.
3123 You must pass in valid pointers to arrays of 256 16-bit quantities.
3124 Any of the pointers may be NULL to ignore that channel.
3125 If the call succeeds, it will return 0. If the display driver or
3126 hardware does not support gamma translation, or otherwise fails,
3127 this function will return -1. }
3129 function SDL_GetGammaRamp( redtable: PUInt16; greentable: PUInt16; bluetable: PUInt16): Integer;
3130 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GetGammaRamp'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3131 {$EXTERNALSYM SDL_GetGammaRamp}
3133 { Sets a portion of the colormap for the given 8-bit surface. If 'surface'
3134 is not a palettized surface, this function does nothing, returning 0.
3135 If all of the colors were set as passed to SDL_SetColors(), it will
3136 return 1. If not all the color entries were set exactly as given,
3137 it will return 0, and you should look at the surface palette to
3138 determine the actual color palette.
3140 When 'surface' is the surface associated with the current display, the
3141 display colormap will be updated with the requested colors. If
3142 SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors()
3143 will always return 1, and the palette is guaranteed to be set the way
3144 you desire, even if the window colormap has to be warped or run under
3145 emulation. }
3148 function SDL_SetColors(surface: PSDL_Surface; colors: PSDL_Color; firstcolor : Integer; ncolors: Integer) : Integer;
3149 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_SetColors'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3150 {$EXTERNALSYM SDL_SetColors}
3152 { Sets a portion of the colormap for a given 8-bit surface.
3153 'flags' is one or both of:
3154 SDL_LOGPAL -- set logical palette, which controls how blits are mapped
3155 to/from the surface,
3156 SDL_PHYSPAL -- set physical palette, which controls how pixels look on
3157 the screen
3158 Only screens have physical palettes. Separate change of physical/logical
3159 palettes is only possible if the screen has SDL_HWPALETTE set.
3161 The return value is 1 if all colours could be set as requested, and 0
3162 otherwise.
3164 SDL_SetColors() is equivalent to calling this function with
3165 flags = (SDL_LOGPAL or SDL_PHYSPAL). }
3167 function SDL_SetPalette(surface: PSDL_Surface; flags: Integer; colors: PSDL_Color; firstcolor: Integer; ncolors: Integer): Integer;
3168 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_SetPalette'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3169 {$EXTERNALSYM SDL_SetPalette}
3171 { Maps an RGB triple to an opaque pixel value for a given pixel format }
3173 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_MapRGB'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3174 {$EXTERNALSYM SDL_MapRGB}
3176 { Maps an RGBA quadruple to a pixel value for a given pixel format }
3177 function SDL_MapRGBA(format: PSDL_PixelFormat; r: UInt8; g: UInt8; b: UInt8; a: UInt8): UInt32;
3178 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_MapRGBA'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3179 {$EXTERNALSYM SDL_MapRGBA}
3181 { Maps a pixel value into the RGB components for a given pixel format }
3183 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GetRGB'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3184 {$EXTERNALSYM SDL_GetRGB}
3186 { Maps a pixel value into the RGBA components for a given pixel format }
3187 procedure SDL_GetRGBA(pixel: UInt32; fmt: PSDL_PixelFormat; r: PUInt8; g: PUInt8; b: PUInt8; a: PUInt8);
3188 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GetRGBA'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3189 {$EXTERNALSYM SDL_GetRGBA}
3191 { Allocate and free an RGB surface (must be called after SDL_SetVideoMode)
3192 If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
3193 If the depth is greater than 8 bits, the pixel format is set using the
3194 flags '[RGB]mask'.
3195 If the function runs out of memory, it will return NULL.
3197 The 'flags' tell what kind of surface to create.
3198 SDL_SWSURFACE means that the surface should be created in system memory.
3199 SDL_HWSURFACE means that the surface should be created in video memory,
3200 with the same format as the display surface. This is useful for surfaces
3201 that will not change much, to take advantage of hardware acceleration
3202 when being blitted to the display surface.
3203 SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with
3204 this surface, but you must always lock it before accessing the pixels.
3205 SDL will wait for current blits to finish before returning from the lock.
3206 SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits.
3207 If the hardware supports acceleration of colorkey blits between
3208 two surfaces in video memory, SDL will try to place the surface in
3209 video memory. If this isn't possible or if there is no hardware
3210 acceleration available, the surface will be placed in system memory.
3211 SDL_SRCALPHA means that the surface will be used for alpha blits and
3212 if the hardware supports hardware acceleration of alpha blits between
3213 two surfaces in video memory, to place the surface in video memory
3214 if possible, otherwise it will be placed in system memory.
3215 If the surface is created in video memory, blits will be _much_ faster,
3216 but the surface format must be identical to the video surface format,
3217 and the only way to access the pixels member of the surface is to use
3218 the SDL_LockSurface() and SDL_UnlockSurface() calls.
3219 If the requested surface actually resides in video memory, SDL_HWSURFACE
3220 will be set in the flags member of the returned surface. If for some
3221 reason the surface could not be placed in video memory, it will not have
3222 the SDL_HWSURFACE flag set, and will be created in system memory instead. }
3226 {$EXTERNALSYM SDL_AllocSurface}
3228 function SDL_CreateRGBSurface(flags: UInt32; width, height, depth: Integer; RMask, GMask, BMask, AMask: UInt32): PSDL_Surface;
3229 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CreateRGBSurface'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3230 {$EXTERNALSYM SDL_CreateRGBSurface}
3234 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CreateRGBSurfaceFrom'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3235 {$EXTERNALSYM SDL_CreateRGBSurfaceFrom}
3238 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_FreeSurface'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3239 {$EXTERNALSYM SDL_FreeSurface}
3242 {$EXTERNALSYM SDL_MustLock}
3243 { SDL_LockSurface() sets up a surface for directly accessing the pixels.
3244 Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write
3245 to and read from 'surface->pixels', using the pixel format stored in
3246 'surface->format'. Once you are done accessing the surface, you should
3247 use SDL_UnlockSurface() to release it.
3249 Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates
3250 to 0, then you can read and write to the surface at any time, and the
3251 pixel format of the surface will not change. In particular, if the
3252 SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you
3253 will not need to lock the display surface before accessing it.
3255 No operating system or library calls should be made between lock/unlock
3256 pairs, as critical system locks may be held during this time.
3258 SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked. }
3260 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_LockSurface'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3261 {$EXTERNALSYM SDL_LockSurface}
3264 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_UnlockSurface'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3265 {$EXTERNALSYM SDL_UnlockSurface}
3267 { Load a surface from a seekable SDL data source (memory or file.)
3268 If 'freesrc' is non-zero, the source will be closed after being read.
3269 Returns the new surface, or NULL if there was an error.
3270 The new surface should be freed with SDL_FreeSurface(). }
3272 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_LoadBMP_RW'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3273 {$EXTERNALSYM SDL_LoadBMP_RW}
3275 // Convenience macro -- load a surface from a file
3277 {$EXTERNALSYM SDL_LoadBMP}
3279 { Save a surface to a seekable SDL data source (memory or file.)
3280 If 'freedst' is non-zero, the source will be closed after being written.
3281 Returns 0 if successful or -1 if there was an error. }
3284 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_SaveBMP_RW'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3285 {$EXTERNALSYM SDL_SaveBMP_RW}
3287 // Convenience macro -- save a surface to a file
3289 {$EXTERNALSYM SDL_SaveBMP}
3291 { Sets the color key (transparent pixel) in a blittable surface.
3292 If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL),
3293 'key' will be the transparent pixel in the source image of a blit.
3294 SDL_RLEACCEL requests RLE acceleration for the surface if present,
3295 and removes RLE acceleration if absent.
3296 If 'flag' is 0, this function clears any current color key.
3297 This function returns 0, or -1 if there was an error. }
3300 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_SetColorKey'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3301 {$EXTERNALSYM SDL_SetColorKey}
3303 { This function sets the alpha value for the entire surface, as opposed to
3304 using the alpha component of each pixel. This value measures the range
3305 of transparency of the surface, 0 being completely transparent to 255
3306 being completely opaque. An 'alpha' value of 255 causes blits to be
3307 opaque, the source pixels copied to the destination (the default). Note
3308 that per-surface alpha can be combined with colorkey transparency.
3310 If 'flag' is 0, alpha blending is disabled for the surface.
3311 If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface.
3312 OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the
3313 surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed. }
3317 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_SetAlpha'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3318 {$EXTERNALSYM SDL_SetAlpha}
3320 { Sets the clipping rectangle for the destination surface in a blit.
3322 If the clip rectangle is NULL, clipping will be disabled.
3323 If the clip rectangle doesn't intersect the surface, the function will
3324 return SDL_FALSE and blits will be completely clipped. Otherwise the
3325 function returns SDL_TRUE and blits to the surface will be clipped to
3326 the intersection of the surface area and the clipping rectangle.
3328 Note that blits are automatically clipped to the edges of the source
3329 and destination surfaces. }
3331 external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_SetClipRect'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3332 {$EXTERNALSYM SDL_SetClipRect}
3334 { Gets the clipping rectangle for the destination surface in a blit.
3335 'rect' must be a pointer to a valid rectangle which will be filled
3336 with the correct values. }
3338 external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GetClipRect'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3339 {$EXTERNALSYM SDL_GetClipRect}
3341 { Creates a new surface of the specified format, and then copies and maps
3342 the given surface to it so the blit of the converted surface will be as
3343 fast as possible. If this function fails, it returns NULL.
3345 The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those
3346 semantics. You can also pass SDL_RLEACCEL in the flags parameter and
3347 SDL will try to RLE accelerate colorkey and alpha blits in the resulting
3348 surface.
3350 This function is used internally by SDL_DisplayFormat(). }
3352 function SDL_ConvertSurface(src: PSDL_Surface; fmt: PSDL_PixelFormat; flags: UInt32): PSDL_Surface;
3353 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_ConvertSurface'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3354 {$EXTERNALSYM SDL_ConvertSurface}
3356 {
3357 This performs a fast blit from the source surface to the destination
3358 surface. It assumes that the source and destination rectangles are
3359 the same size. If either 'srcrect' or 'dstrect' are NULL, the entire
3360 surface (src or dst) is copied. The final blit rectangles are saved
3361 in 'srcrect' and 'dstrect' after all clipping is performed.
3362 If the blit is successful, it returns 0, otherwise it returns -1.
3364 The blit function should not be called on a locked surface.
3366 The blit semantics for surfaces with and without alpha and colorkey
3367 are defined as follows:
3369 RGBA->RGB:
3370 SDL_SRCALPHA set:
3371 alpha-blend (using alpha-channel).
3372 SDL_SRCCOLORKEY ignored.
3373 SDL_SRCALPHA not set:
3374 copy RGB.
3375 if SDL_SRCCOLORKEY set, only copy the pixels matching the
3376 RGB values of the source colour key, ignoring alpha in the
3377 comparison.
3379 RGB->RGBA:
3380 SDL_SRCALPHA set:
3381 alpha-blend (using the source per-surface alpha value);
3382 set destination alpha to opaque.
3383 SDL_SRCALPHA not set:
3384 copy RGB, set destination alpha to opaque.
3385 both:
3386 if SDL_SRCCOLORKEY set, only copy the pixels matching the
3387 source colour key.
3389 RGBA->RGBA:
3390 SDL_SRCALPHA set:
3391 alpha-blend (using the source alpha channel) the RGB values;
3392 leave destination alpha untouched. [Note: is this correct?]
3393 SDL_SRCCOLORKEY ignored.
3394 SDL_SRCALPHA not set:
3395 copy all of RGBA to the destination.
3396 if SDL_SRCCOLORKEY set, only copy the pixels matching the
3397 RGB values of the source colour key, ignoring alpha in the
3398 comparison.
3400 RGB->RGB:
3401 SDL_SRCALPHA set:
3402 alpha-blend (using the source per-surface alpha value).
3403 SDL_SRCALPHA not set:
3404 copy RGB.
3405 both:
3406 if SDL_SRCCOLORKEY set, only copy the pixels matching the
3407 source colour key.
3409 If either of the surfaces were in video memory, and the blit returns -2,
3410 the video memory was lost, so it should be reloaded with artwork and
3411 re-blitted:
3412 while ( SDL_BlitSurface(image, imgrect, screen, dstrect) = -2 ) do
3413 begin
3414 while ( SDL_LockSurface(image) < 0 ) do
3415 Sleep(10);
3416 -- Write image pixels to image->pixels --
3417 SDL_UnlockSurface(image);
3418 end;
3420 This happens under DirectX 5.0 when the system switches away from your
3421 fullscreen application. The lock will also fail until you have access
3422 to the video memory again. }
3424 { You should call SDL_BlitSurface() unless you know exactly how SDL
3425 blitting works internally and how to use the other blit functions. }
3427 function SDL_BlitSurface(src: PSDL_Surface; srcrect: PSDL_Rect; dst: PSDL_Surface; dstrect: PSDL_Rect): Integer;
3428 {$EXTERNALSYM SDL_BlitSurface}
3430 { This is the public blit function, SDL_BlitSurface(), and it performs
3431 rectangle validation and clipping before passing it to SDL_LowerBlit() }
3432 function SDL_UpperBlit(src: PSDL_Surface; srcrect: PSDL_Rect; dst: PSDL_Surface; dstrect: PSDL_Rect): Integer;
3433 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_UpperBlit'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3434 {$EXTERNALSYM SDL_UpperBlit}
3436 { This is a semi-private blit function and it performs low-level surface
3437 blitting only. }
3438 function SDL_LowerBlit(src: PSDL_Surface; srcrect: PSDL_Rect; dst: PSDL_Surface; dstrect: PSDL_Rect): Integer;
3439 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_LowerBlit'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3440 {$EXTERNALSYM SDL_LowerBlit}
3442 { This function performs a fast fill of the given rectangle with 'color'
3443 The given rectangle is clipped to the destination surface clip area
3444 and the final fill rectangle is saved in the passed in pointer.
3445 If 'dstrect' is NULL, the whole surface will be filled with 'color'
3446 The color should be a pixel of the format used by the surface, and
3447 can be generated by the SDL_MapRGB() function.
3448 This function returns 0 on success, or -1 on error. }
3451 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_FillRect'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3452 {$EXTERNALSYM SDL_FillRect}
3454 { This function takes a surface and copies it to a new surface of the
3455 pixel format and colors of the video framebuffer, suitable for fast
3456 blitting onto the display surface. It calls SDL_ConvertSurface()
3458 If you want to take advantage of hardware colorkey or alpha blit
3459 acceleration, you should set the colorkey and alpha value before
3460 calling this function.
3462 If the conversion fails or runs out of memory, it returns NULL }
3465 external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_DisplayFormat'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3466 {$EXTERNALSYM SDL_DisplayFormat}
3468 { This function takes a surface and copies it to a new surface of the
3469 pixel format and colors of the video framebuffer (if possible),
3470 suitable for fast alpha blitting onto the display surface.
3471 The new surface will always have an alpha channel.
3473 If you want to take advantage of hardware colorkey or alpha blit
3474 acceleration, you should set the colorkey and alpha value before
3475 calling this function.
3477 If the conversion fails or runs out of memory, it returns NULL }
3481 external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_DisplayFormatAlpha'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3482 {$EXTERNALSYM SDL_DisplayFormatAlpha}
3484 //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
3485 //* YUV video surface overlay functions */
3486 //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
3488 { This function creates a video output overlay
3489 Calling the returned surface an overlay is something of a misnomer because
3490 the contents of the display surface underneath the area where the overlay
3491 is shown is undefined - it may be overwritten with the converted YUV data. }
3493 function SDL_CreateYUVOverlay(width: Integer; height: Integer; format: UInt32; display: PSDL_Surface): PSDL_Overlay;
3494 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CreateYUVOverlay'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3495 {$EXTERNALSYM SDL_CreateYUVOverlay}
3497 // Lock an overlay for direct access, and unlock it when you are done
3499 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_LockYUVOverlay'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3500 {$EXTERNALSYM SDL_LockYUVOverlay}
3503 external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_UnlockYUVOverlay'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3504 {$EXTERNALSYM SDL_UnlockYUVOverlay}
3507 { Blit a video overlay to the display surface.
3508 The contents of the video surface underneath the blit destination are
3509 not defined.
3510 The width and height of the destination rectangle may be different from
3511 that of the overlay, but currently only 2x scaling is supported. }
3514 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_DisplayYUVOverlay'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3515 {$EXTERNALSYM SDL_DisplayYUVOverlay}
3517 // Free a video overlay
3519 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_FreeYUVOverlay'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3520 {$EXTERNALSYM SDL_FreeYUVOverlay}
3522 {------------------------------------------------------------------------------}
3523 { OpenGL Routines }
3524 {------------------------------------------------------------------------------}
3526 { Dynamically load a GL driver, if SDL is built with dynamic GL.
3528 SDL links normally with the OpenGL library on your system by default,
3529 but you can compile it to dynamically load the GL driver at runtime.
3530 If you do this, you need to retrieve all of the GL functions used in
3531 your program from the dynamic library using SDL_GL_GetProcAddress().
3533 This is disabled in default builds of SDL. }
3537 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GL_LoadLibrary'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3538 {$EXTERNALSYM SDL_GL_LoadLibrary}
3540 { Get the address of a GL function (for extension functions) }
3542 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GL_GetProcAddress'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3543 {$EXTERNALSYM SDL_GL_GetProcAddress}
3545 { Set an attribute of the OpenGL subsystem before intialization. }
3547 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GL_SetAttribute'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3548 {$EXTERNALSYM SDL_GL_SetAttribute}
3550 { Get an attribute of the OpenGL subsystem from the windowing
3551 interface, such as glX. This is of course different from getting
3552 the values from SDL's internal OpenGL subsystem, which only
3553 stores the values you request before initialization.
3555 Developers should track the values they pass into SDL_GL_SetAttribute
3556 themselves if they want to retrieve these values. }
3559 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GL_GetAttribute'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3560 {$EXTERNALSYM SDL_GL_GetAttribute}
3562 { Swap the OpenGL buffers, if double-buffering is supported. }
3565 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GL_SwapBuffers'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3566 {$EXTERNALSYM SDL_GL_SwapBuffers;}
3568 { Internal functions that should not be called unless you have read
3569 and understood the source code for these functions. }
3572 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GL_UpdateRects'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3573 {$EXTERNALSYM SDL_GL_UpdateRects}
3575 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GL_Lock'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3576 {$EXTERNALSYM SDL_GL_Lock;}
3578 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GL_Unlock'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3579 {$EXTERNALSYM SDL_GL_Unlock;}
3581 {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
3582 {* These functions allow interaction with the window manager, if any. *}
3583 {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
3585 { Sets/Gets the title and icon text of the display window }
3587 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_WM_GetCaption'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3588 {$EXTERNALSYM SDL_WM_GetCaption}
3590 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_WM_SetCaption'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3591 {$EXTERNALSYM SDL_WM_SetCaption}
3593 { Sets the icon for the display window.
3594 This function must be called before the first call to SDL_SetVideoMode().
3595 It takes an icon surface, and a mask in MSB format.
3596 If 'mask' is NULL, the entire icon surface will be used as the icon. }
3598 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_WM_SetIcon'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3599 {$EXTERNALSYM SDL_WM_SetIcon}
3601 { This function iconifies the window, and returns 1 if it succeeded.
3602 If the function succeeds, it generates an SDL_APPACTIVE loss event.
3603 This function is a noop and returns 0 in non-windowed environments. }
3606 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_WM_IconifyWindow'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3607 {$EXTERNALSYM SDL_WM_IconifyWindow}
3609 { Toggle fullscreen mode without changing the contents of the screen.
3610 If the display surface does not require locking before accessing
3611 the pixel information, then the memory pointers will not change.
3613 If this function was able to toggle fullscreen mode (change from
3614 running in a window to fullscreen, or vice-versa), it will return 1.
3615 If it is not implemented, or fails, it returns 0.
3617 The next call to SDL_SetVideoMode() will set the mode fullscreen
3618 attribute based on the flags parameter - if SDL_FULLSCREEN is not
3619 set, then the display will be windowed by default where supported.
3621 This is currently only implemented in the X11 video driver. }
3624 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_WM_ToggleFullScreen'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3625 {$EXTERNALSYM SDL_WM_ToggleFullScreen}
3627 { Grabbing means that the mouse is confined to the application window,
3628 and nearly all keyboard input is passed directly to the application,
3629 and not interpreted by a window manager, if any. }
3632 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_WM_GrabInput'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3633 {$EXTERNALSYM SDL_WM_GrabInput}
3635 {------------------------------------------------------------------------------}
3636 { mouse-routines }
3637 {------------------------------------------------------------------------------}
3639 { Retrieve the current state of the mouse.
3640 The current button state is returned as a button bitmask, which can
3641 be tested using the SDL_BUTTON(X) macros, and x and y are set to the
3642 current mouse cursor position. You can pass NULL for either x or y. }
3645 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GetMouseState'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3646 {$EXTERNALSYM SDL_GetMouseState}
3648 { Retrieve the current state of the mouse.
3649 The current button state is returned as a button bitmask, which can
3650 be tested using the SDL_BUTTON(X) macros, and x and y are set to the
3651 mouse deltas since the last call to SDL_GetRelativeMouseState(). }
3653 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GetRelativeMouseState'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3654 {$EXTERNALSYM SDL_GetRelativeMouseState}
3656 { Set the position of the mouse cursor (generates a mouse motion event) }
3658 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_WarpMouse'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3659 {$EXTERNALSYM SDL_WarpMouse}
3661 { Create a cursor using the specified data and mask (in MSB format).
3662 The cursor width must be a multiple of 8 bits.
3664 The cursor is created in black and white according to the following:
3665 data mask resulting pixel on screen
3666 0 1 White
3667 1 1 Black
3668 0 0 Transparent
3669 1 0 Inverted color if possible, black if not.
3671 Cursors created with this function must be freed with SDL_FreeCursor(). }
3673 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CreateCursor'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3674 {$EXTERNALSYM SDL_CreateCursor}
3676 { Set the currently active cursor to the specified one.
3677 If the cursor is currently visible, the change will be immediately
3678 represented on the display. }
3680 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_SetCursor'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3681 {$EXTERNALSYM SDL_SetCursor}
3683 { Returns the currently active cursor. }
3685 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GetCursor'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3686 {$EXTERNALSYM SDL_GetCursor}
3688 { Deallocates a cursor created with SDL_CreateCursor(). }
3690 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_FreeCursor'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3691 {$EXTERNALSYM SDL_FreeCursor}
3693 { Toggle whether or not the cursor is shown on the screen.
3694 The cursor start off displayed, but can be turned off.
3695 SDL_ShowCursor() returns 1 if the cursor was being displayed
3696 before the call, or 0 if it was not. You can query the current
3697 state by passing a 'toggle' value of -1. }
3699 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_ShowCursor'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3700 {$EXTERNALSYM SDL_ShowCursor}
3704 {------------------------------------------------------------------------------}
3705 { Keyboard-routines }
3706 {------------------------------------------------------------------------------}
3708 { Enable/Disable UNICODE translation of keyboard input.
3709 This translation has some overhead, so translation defaults off.
3710 If 'enable' is 1, translation is enabled.
3711 If 'enable' is 0, translation is disabled.
3712 If 'enable' is -1, the translation state is not changed.
3713 It returns the previous state of keyboard translation. }
3715 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_EnableUNICODE'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3716 {$EXTERNALSYM SDL_EnableUNICODE}
3718 { If 'delay' is set to 0, keyboard repeat is disabled. }
3720 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_EnableKeyRepeat'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3721 {$EXTERNALSYM SDL_EnableKeyRepeat}
3724 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GetKeyRepeat'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3725 {$EXTERNALSYM SDL_GetKeyRepeat}
3727 { Get a snapshot of the current state of the keyboard.
3728 Returns an array of keystates, indexed by the SDLK_* syms.
3729 Used:
3731 UInt8 *keystate = SDL_GetKeyState(NULL);
3732 if ( keystate[SDLK_RETURN] ) ... <RETURN> is pressed }
3735 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GetKeyState'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3736 {$EXTERNALSYM SDL_GetKeyState}
3738 { Get the current key modifier state }
3740 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GetModState'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3741 {$EXTERNALSYM SDL_GetModState}
3743 { Set the current key modifier state
3744 This does not change the keyboard state, only the key modifier flags. }
3746 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_SetModState'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3747 {$EXTERNALSYM SDL_SetModState}
3749 { Get the name of an SDL virtual keysym }
3751 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GetKeyName'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3752 {$EXTERNALSYM SDL_GetKeyName}
3754 {------------------------------------------------------------------------------}
3755 { Active Routines }
3756 {------------------------------------------------------------------------------}
3758 { This function returns the current state of the application, which is a
3759 bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and
3760 SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to
3761 see your application, otherwise it has been iconified or disabled. }
3764 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GetAppState'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3765 {$EXTERNALSYM SDL_GetAppState}
3768 { Mutex functions }
3770 { Create a mutex, initialized unlocked }
3773 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CreateMutex'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3774 {$EXTERNALSYM SDL_CreateMutex}
3776 { Lock the mutex (Returns 0, or -1 on error) }
3779 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_mutexP'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3780 { $ EXTERNALSYM SDL_mutexP}
3783 {$EXTERNALSYM SDL_LockMutex}
3785 { Unlock the mutex (Returns 0, or -1 on error) }
3787 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_mutexV'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3788 {$EXTERNALSYM SDL_mutexV}
3791 {$EXTERNALSYM SDL_UnlockMutex}
3793 { Destroy a mutex }
3795 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_DestroyMutex'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3796 {$EXTERNALSYM SDL_DestroyMutex}
3798 { * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * }
3799 { Semaphore functions }
3800 { * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * }
3801 { Create a semaphore, initialized with value, returns NULL on failure. }
3803 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CreateSemaphore'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3804 {$EXTERNALSYM SDL_CreateSemaphore}
3807 { Destroy a semaphore }
3809 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_DestroySemaphore'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3810 {$EXTERNALSYM SDL_DestroySemaphore}
3812 { This function suspends the calling thread until the semaphore pointed
3813 to by sem has a positive count. It then atomically decreases the semaphore
3814 count. }
3817 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_SemWait'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3818 {$EXTERNALSYM SDL_SemWait}
3820 { Non-blocking variant of SDL_SemWait(), returns 0 if the wait succeeds,
3821 SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error. }
3824 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_SemTryWait'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3825 {$EXTERNALSYM SDL_SemTryWait}
3827 { Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if
3828 the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in
3829 the allotted time, and -1 on error.
3830 On some platforms this function is implemented by looping with a delay
3831 of 1 ms, and so should be avoided if possible. }
3834 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_SemWaitTimeout'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3835 {$EXTERNALSYM SDL_SemTryWait}
3837 { Atomically increases the semaphore's count (not blocking), returns 0,
3838 or -1 on error. }
3841 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_SemPost'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3842 {$EXTERNALSYM SDL_SemTryWait}
3844 { Returns the current count of the semaphore }
3847 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_SemValue'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3848 {$EXTERNALSYM SDL_SemValue}
3850 { * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * }
3851 { Condition variable functions }
3852 { * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * }
3853 { Create a condition variable }
3855 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CreateCond'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3856 {$EXTERNALSYM SDL_CreateCond}
3858 { Destroy a condition variable }
3860 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_DestroyCond'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3861 {$EXTERNALSYM SDL_DestroyCond}
3863 { Restart one of the threads that are waiting on the condition variable,
3864 returns 0 or -1 on error. }
3867 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CondSignal'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3868 {$EXTERNALSYM SDL_CondSignal}
3870 { Restart all threads that are waiting on the condition variable,
3871 returns 0 or -1 on error. }
3874 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CondBroadcast'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3875 {$EXTERNALSYM SDL_CondBroadcast}
3878 { Wait on the condition variable, unlocking the provided mutex.
3879 The mutex must be locked before entering this function!
3880 Returns 0 when it is signaled, or -1 on error. }
3883 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CondWait'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3884 {$EXTERNALSYM SDL_CondWait}
3886 { Waits for at most 'ms' milliseconds, and returns 0 if the condition
3887 variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not
3888 signaled in the allotted time, and -1 on error.
3889 On some platforms this function is implemented by looping with a delay
3890 of 1 ms, and so should be avoided if possible. }
3893 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CondWaitTimeout'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3894 {$EXTERNALSYM SDL_CondWaitTimeout}
3896 { * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * }
3897 { Condition variable functions }
3898 { * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * }
3900 { Create a thread }
3902 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_CreateThread'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3903 {$EXTERNALSYM SDL_CreateThread}
3905 { Get the 32-bit thread identifier for the current thread }
3907 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_ThreadID'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3908 {$EXTERNALSYM SDL_ThreadID}
3910 { Get the 32-bit thread identifier for the specified thread,
3911 equivalent to SDL_ThreadID() if the specified thread is NULL. }
3913 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GetThreadID'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3914 {$EXTERNALSYM SDL_GetThreadID}
3916 { Wait for a thread to finish.
3917 The return code for the thread function is placed in the area
3918 pointed to by 'status', if 'status' is not NULL. }
3921 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_WaitThread'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3922 {$EXTERNALSYM SDL_WaitThread}
3924 { Forcefully kill a thread without worrying about its state }
3926 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_KillThread'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3927 {$EXTERNALSYM SDL_KillThread}
3929 {------------------------------------------------------------------------------}
3930 { Get Environment Routines }
3931 {------------------------------------------------------------------------------}
3932 {$IFDEF WINDOWS}
3935 {$ENDIF}
3937 {$IFDEF Unix}
3938 {$IFDEF FPC}
3941 {$ENDIF}
3942 {$ENDIF}
3944 { Put a variable of the form "name=value" into the environment }
3945 //function SDL_putenv(const variable: PChar): integer; cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_Init'{$ELSE} SDLLibName{$ENDIF __GPC__}SDLLibName name '';
3947 {$EXTERNALSYM SDL_putenv}
3949 // The following function has been commented out to encourage developers to use
3950 // SDL_putenv as it it more portable
3951 //function putenv(const variable: PChar): integer;
3952 //{$EXTERNALSYM putenv}
3954 {$IFDEF WINDOWS}
3955 {$IFNDEF __GPC__}
3957 {$ENDIF}
3958 {$ENDIF}
3960 {* Retrieve a variable named "name" from the environment }
3961 //function SDL_getenv(const name: PChar): PChar; cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_Init'{$ELSE} SDLLibName{$ENDIF __GPC__}SDLLibName name '';
3963 {$EXTERNALSYM SDL_getenv}
3965 // The following function has been commented out to encourage developers to use
3966 // SDL_getenv as it it more portable
3967 //function getenv(const name: PChar): PChar;
3968 //{$EXTERNALSYM getenv}
3970 {*
3971 * This function gives you custom hooks into the window manager information.
3972 * It fills the structure pointed to by 'info' with custom information and
3973 * returns 1 if the function is implemented. If it's not implemented, or
3974 * the version member of the 'info' structure is invalid, it returns 0.
3975 *}
3977 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_GetWMInfo'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3978 {$EXTERNALSYM SDL_GetWMInfo}
3980 {------------------------------------------------------------------------------}
3982 //SDL_loadso.h
3983 {* This function dynamically loads a shared object and returns a pointer
3984 * to the object handle (or NULL if there was an error).
3985 * The 'sofile' parameter is a system dependent name of the object file.
3986 *}
3988 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_LoadObject'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3989 {$EXTERNALSYM SDL_LoadObject}
3991 {* Given an object handle, this function looks up the address of the
3992 * named function in the shared object and returns it. This address
3993 * is no longer valid after calling SDL_UnloadObject().
3994 *}
3996 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_LoadFunction'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
3997 {$EXTERNALSYM SDL_LoadFunction}
3999 {* Unload a shared object from memory *}
4001 cdecl; external {$IFNDEF NDS}{$IFDEF __GPC__}name 'SDL_UnloadObject'{$ELSE} SDLLibName{$ENDIF __GPC__}{$ENDIF};
4002 {$EXTERNALSYM SDL_UnloadObject}
4006 {------------------------------------------------------------------------------}
4009 {$EXTERNALSYM SDL_Swap32}
4011 {$ENDIF MORPHOS}
4013 { FreeAndNil frees the given TObject instance and sets the variable reference
4014 to nil. Be careful to only pass TObjects to this routine. }
4017 { Exit procedure handling }
4019 { AddExitProc adds the given procedure to the run-time library's exit
4020 procedure list. When an application terminates, its exit procedures are
4021 executed in reverse order of definition, i.e. the last procedure passed
4022 to AddExitProc is the first one to get executed upon termination. }
4025 // Bitwise Checking functions
4032 implementation
4034 {$IFDEF __GPC__}
4036 {$ENDIF}
4039 begin
4044 begin
4045 {$IFNDEF WINDOWS}
4047 {$ENDIF}
4051 begin
4056 begin
4061 begin
4066 begin
4071 begin
4075 function SDL_LoadWAV(filename: PChar; spec: PSDL_AudioSpec; audio_buf: PUInt8; audiolen: PUInt32): PSDL_AudioSpec;
4076 begin
4081 begin
4087 var
4089 begin
4099 begin
4104 begin
4111 begin
4116 begin
4118 );
4122 begin
4127 begin
4132 begin
4137 PSDL_Surface;
4139 begin
4145 begin
4151 begin
4157 begin
4162 begin
4166 {$IFDEF WINDOWS}
4169 {$ENDIF}
4173 begin
4174 {$IFDEF WINDOWS}
4176 {$ENDIF}
4178 {$IFDEF UNIX}
4179 {$IFDEF FPC}
4181 {$ELSE}
4183 {$ENDIF}
4184 {$ENDIF}
4187 {$IFDEF WINDOWS}
4188 {$IFNDEF __GPC__}
4191 {$ENDIF}
4192 {$ENDIF}
4195 begin
4196 {$IFDEF WINDOWS}
4198 {$IFDEF __GPC__}
4200 {$ELSE}
4202 {$ENDIF}
4204 {$ELSE}
4206 {$IFDEF UNIX}
4208 {$IFDEF FPC}
4210 {$ELSE}
4212 {$ENDIF}
4214 {$ELSE UNIX}
4215 {$IFDEF OS2}
4217 {$ENDIF OS2}
4218 {$ENDIF}
4220 {$ENDIF}
4224 begin
4229 begin
4230 Result := ((D shl 24) or ((D shl 8) and $00FF0000) or ((D shr 8) and $0000FF00) or (D shr 24));
4234 {$IFNDEF __GPC__}
4235 {$IFNDEF __TMT__}
4236 var
4238 {$ENDIF}
4239 {$ENDIF}
4240 begin
4241 {$IFNDEF __GPC__}
4242 {$IFNDEF __TMT__}
4246 {$ENDIF}
4247 {$ENDIF}
4250 { Exit procedure handling }
4251 type
4259 var
4263 var
4266 begin
4272 Proc;
4276 var
4278 begin
4288 begin
4293 begin
4298 begin