actual version
[sdl-headers.git] / sdlvideo.inc
1 //from "sdl_video.h"
2
3   {**
4    *  The structure that defines a display mode
5    *
6    *   SDL_GetNumDisplayModes()
7    *   SDL_GetDisplayMode()
8    *   SDL_GetDesktopDisplayMode()
9    *   SDL_GetCurrentDisplayMode()
10    *   SDL_GetClosestDisplayMode()
11    *   SDL_SetWindowDisplayMode()
12    *   SDL_GetWindowDisplayMode()
13    *}
14
15   PSDL_DisplayMode = ^TSDL_DisplayMode;
16   TSDL_DisplayMode = record
17     format: UInt32;              {**< pixel format *}
18     w: SInt32;                   {**< width *}
19     h: SInt32;                   {**< height *}
20     refresh_rate: SInt32;        {**< refresh rate (or zero for unspecified) *}
21     driverdata: Pointer;         {**< driver-specific data, initialize to 0 *}
22   end;
23
24   {* Define the SDL window-shaper structure *}
25   PSDL_WindowShaper = ^TSDL_WindowShaper;
26   TSDL_WindowShaper = record
27     {* The window associated with the shaper *}
28     window: PSDL_Window;
29
30     {* The user's specified coordinates for the window, for once we give it a shape. *}
31     userx,usery: UInt32;
32
33     {* The parameters for shape calculation. *}
34     mode: TSDL_WindowShapeMode;
35
36     {* Has this window been assigned a shape? *}
37     hasshape: TSDL_Bool;
38
39     driverdata: Pointer;
40   end;
41
42   PSDL_WindowUserData = ^TSDL_WindowUserData;
43   TSDL_WindowUserData = record
44     name: PAnsiChar;
45     data: Pointer;
46     next: PSDL_WindowUserData;
47   end;
48
49   {* Define the SDL window structure, corresponding to toplevel windows *}
50   TSDL_Window = record
51     magic: Pointer;
52     id: UInt32;
53     title: PAnsiChar;
54     x,y: SInt32;
55     w,h: SInt32;
56     min_w, min_h: SInt32;
57     max_w, max_h: SInt32;
58     flags: UInt32;
59
60     {* Stored position and size for windowed mode * }
61     windowed: TSDL_Rect;
62
63     fullscreen_mode: TSDL_DisplayMode;
64
65     brightness: Float;
66     gamma: PUInt16;
67     saved_gamma: PUInt16;  {* (just offset into gamma) *}
68
69     surface: PSDL_Surface;
70     surface_valid: TSDL_Bool;
71
72     shaper: PSDL_WindowShaper;
73
74     data: PSDL_WindowUserData;
75
76     driverdata: Pointer;
77
78     prev: PSDL_Window;
79     next: PSDL_Window;
80   end;
81
82   {**
83    * Get the shape parameters of a shaped window.
84    *
85    *  window The shaped window whose parameters should be retrieved.
86    *  shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape.
87    *
88    *  0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode
89    *  data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if
90    *  the SDL_Window* given is a shapeable window currently lacking a shape.
91    *
92    *  SDL_WindowShapeMode
93    *  SDL_SetWindowShape
94    *}
95 function SDL_GetShapedWindowMode(window: PSDL_Window; shape_mode: TSDL_WindowShapeMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetShapedWindowMode' {$ENDIF} {$ENDIF};
96
97   {**
98    * Set the shape and parameters of a shaped window.
99    *
100    *  window The shaped window whose parameters should be set.
101    *  shape A surface encoding the desired shape for the window.
102    *  shape_mode The parameters to set for the shaped window.
103    *
104    *  0 on success, SDL_INVALID_SHAPE_ARGUMENT on invalid an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW
105    *  if the SDL_Window* given does not reference a valid shaped window.
106    *
107    *  SDL_WindowShapeMode
108    *  SDL_GetShapedWindowMode.
109    *}
110 function SDL_SetWindowShape(window: PSDL_Window; shape: PSDL_Surface; shape_mode: PSDL_WindowShapeMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowShape' {$ENDIF} {$ENDIF};
111
112   {**
113    *  Create a window that can be shaped with the specified position, dimensions, and flags.
114    *
115    *   title The title of the window, in UTF-8 encoding.
116    *   x     The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
117    *               ::SDL_WINDOWPOS_UNDEFINED.
118    *   y     The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
119    *               ::SDL_WINDOWPOS_UNDEFINED.
120    *   w     The width of the window.
121    *   h     The height of the window.
122    *   flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following:
123    *         SDL_WINDOW_OPENGL,     SDL_WINDOW_INPUT_GRABBED,
124    *         SDL_WINDOW_SHOWN,      SDL_WINDOW_RESIZABLE,
125    *         SDL_WINDOW_MAXIMIZED,  SDL_WINDOW_MINIMIZED,
126    *         SDL_WINDOW_BORDERLESS is always set, and SDL_WINDOW_FULLSCREEN is always unset.
127    *
128    *   The window created, or NULL if window creation failed.
129    *
130    *  SDL_DestroyWindow()
131    *}
132 function SDL_CreateShapedWindow(title: PAnsiChar; x: UInt32; y: UInt32; w: UInt32; h: UInt32; flags: UInt32): PSDL_Window cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_CreateShapedWindow' {$ENDIF} {$ENDIF};
133
134   {**
135    * Return whether the given window is a shaped window.
136    *
137    *  window The window to query for being shaped.
138    *
139    *  SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL.
140    *  SDL_CreateShapedWindow
141    *}
142 function SDL_IsShapedWindow(window: PSDL_Window): TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_IsShapedWindow' {$ENDIF} {$ENDIF};
143
144   {**
145    *  The type used to identify a window
146    *
147    *   SDL_CreateWindow()
148    *   SDL_CreateWindowFrom()
149    *   SDL_DestroyWindow()
150    *   SDL_GetWindowData()
151    *   SDL_GetWindowFlags()
152    *   SDL_GetWindowGrab()
153    *   SDL_GetWindowPosition()
154    *   SDL_GetWindowSize()
155    *   SDL_GetWindowTitle()
156    *   SDL_HideWindow()
157    *   SDL_MaximizeWindow()
158    *   SDL_MinimizeWindow()
159    *   SDL_RaiseWindow()
160    *   SDL_RestoreWindow()
161    *   SDL_SetWindowData()
162    *   SDL_SetWindowFullscreen()
163    *   SDL_SetWindowGrab()
164    *   SDL_SetWindowIcon()
165    *   SDL_SetWindowPosition()
166    *   SDL_SetWindowSize()
167    *   SDL_SetWindowBordered()
168    *   SDL_SetWindowTitle()
169    *   SDL_ShowWindow()
170    *}
171
172 const
173   {**
174    *  The flags on a window
175    *
176    *   SDL_GetWindowFlags()
177    *}
178
179   SDL_WINDOW_FULLSCREEN = $00000001;         {**< fullscreen window *}
180   SDL_WINDOW_OPENGL = $00000002;             {**< window usable with OpenGL context *}
181   SDL_WINDOW_SHOWN = $00000004;              {**< window is visible *}
182   SDL_WINDOW_HIDDEN = $00000008;             {**< window is not visible *}
183   SDL_WINDOW_BORDERLESS = $00000010;         {**< no window decoration *}
184   SDL_WINDOW_RESIZABLE = $00000020;          {**< window can be resized *}
185   SDL_WINDOW_MINIMIZED = $00000040;          {**< window is minimized *}
186   SDL_WINDOW_MAXIMIZED = $00000080;          {**< window is maximized *}
187   SDL_WINDOW_INPUT_GRABBED = $00000100;      {**< window has grabbed input focus *}
188   SDL_WINDOW_INPUT_FOCUS = $00000200;        {**< window has input focus *}
189   SDL_WINDOW_MOUSE_FOCUS = $00000400;        {**< window has mouse focus *}
190   SDL_WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN or $00001000;
191   SDL_WINDOW_FOREIGN = $00000800;            {**< window not created by SDL *}
192
193 type
194   TSDL_WindowFlags = DWord;
195
196 function SDL_WindowPos_IsUndefined(X: Variant): Variant;
197 function SDL_WindowPos_IsCentered(X: Variant): Variant;
198
199 const
200    {**
201    *  Used to indicate that you don't care what the window position is.
202    *}
203
204   SDL_WINDOWPOS_UNDEFINED_MASK = $1FFF0000;
205   SDL_WINDOWPOS_UNDEFINED = SDL_WINDOWPOS_UNDEFINED_MASK or 0;
206
207
208   {**
209    *  Used to indicate that the window position should be centered.
210    *}
211
212   SDL_WINDOWPOS_CENTERED_MASK = $2FFF0000;
213   SDL_WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED_MASK or 0;
214
215   {**
216    *  Event subtype for window events
217    *}
218
219   SDL_WINDOWEVENT_NONE = 0;           {**< Never used *}
220   SDL_WINDOWEVENT_SHOWN = 1;          {**< Window has been shown *}
221   SDL_WINDOWEVENT_HIDDEN = 2;         {**< Window has been hidden *}
222   SDL_WINDOWEVENT_EXPOSED = 3;        {**< Window has been exposed and should be redrawn *}
223   SDL_WINDOWEVENT_MOVED = 4;          {**< Window has been moved to data1; data2 *}
224   SDL_WINDOWEVENT_RESIZED = 5;        {**< Window has been resized to data1xdata2 *}
225   SDL_WINDOWEVENT_SIZE_CHANGED = 6;   {**< The window size has changed; either as a result of an API call or through the system or user changing the window size. *}
226   SDL_WINDOWEVENT_MINIMIZED = 7;      {**< Window has been minimized *}
227   SDL_WINDOWEVENT_MAXIMIZED = 8;      {**< Window has been maximized *}
228   SDL_WINDOWEVENT_RESTORED = 9;       {**< Window has been restored to normal size and position *}
229   SDL_WINDOWEVENT_ENTER = 10;          {**< Window has gained mouse focus *}
230   SDL_WINDOWEVENT_LEAVE = 11;          {**< Window has lost mouse focus *}
231   SDL_WINDOWEVENT_FOCUS_GAINED = 12;   {**< Window has gained keyboard focus *}
232   SDL_WINDOWEVENT_FOCUS_LOST = 13;     {**< Window has lost keyboard focus *}
233   SDL_WINDOWEVENT_CLOSE = 14;          {**< The window manager requests that the window be closed *}
234
235 type
236   TSDL_WindowEventID = DWord;
237
238   {**
239    *  An opaque handle to an OpenGL context.
240    *}
241
242   TSDL_GLContext = Pointer;
243
244   {**
245    *  OpenGL configuration attributes
246    *}
247    
248 const
249   SDL_GL_RED_SIZE = 0;
250   SDL_GL_GREEN_SIZE = 1;
251   SDL_GL_BLUE_SIZE = 2;
252   SDL_GL_ALPHA_SIZE = 3;
253   SDL_GL_BUFFER_SIZE = 4;
254   SDL_GL_DOUBLEBUFFER = 5;
255   SDL_GL_DEPTH_SIZE = 6;
256   SDL_GL_STENCIL_SIZE = 7;
257   SDL_GL_ACCUM_RED_SIZE = 8;
258   SDL_GL_ACCUM_GREEN_SIZE = 9;
259   SDL_GL_ACCUM_BLUE_SIZE = 10;
260   SDL_GL_ACCUM_ALPHA_SIZE = 11;
261   SDL_GL_STEREO = 12;
262   SDL_GL_MULTISAMPLEBUFFERS = 13;
263   SDL_GL_MULTISAMPLESAMPLES = 14;
264   SDL_GL_ACCELERATED_VISUAL = 15;
265   SDL_GL_RETAINED_BACKING = 16;
266   SDL_GL_CONTEXT_MAJOR_VERSION = 17;
267   SDL_GL_CONTEXT_MINOR_VERSION = 18;
268   SDL_GL_CONTEXT_EGL = 19;
269   SDL_GL_CONTEXT_FLAGS = 20;
270   SDL_GL_CONTEXT_PROFILE_MASK = 21;
271   SDL_GL_SHARE_WITH_CURRENT_CONTEXT = 22;
272
273 type
274   TSDL_GLattr = DWord;
275
276 const
277   SDL_GL_CONTEXT_PROFILE_CORE           = $0001;
278   SDL_GL_CONTEXT_PROFILE_COMPATIBILITY  = $0002;
279   SDL_GL_CONTEXT_PROFILE_ES             = $0004;
280
281 type
282   TSDL_GLprofile = DWord;
283
284 const
285   SDL_GL_CONTEXT_DEBUG_FLAG              = $0001;
286   SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = $0002;
287   SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG      = $0004;
288   SDL_GL_CONTEXT_RESET_ISOLATION_FLAG    = $0008;
289
290 type
291   TSDL_GLcontextFlag = DWord;
292
293   {* Function prototypes *}
294
295   {**
296    *  Get the number of video drivers compiled into SDL
297    *
298    *  SDL_GetVideoDriver()
299    *}
300
301 function SDL_GetNumVideoDrivers: SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetNumVideoDrivers' {$ENDIF} {$ENDIF};
302
303   {**
304    *  Get the name of a built in video driver.
305    *
306    *  The video drivers are presented in the order in which they are
307    *  normally checked during initialization.
308    *
309    *  SDL_GetNumVideoDrivers()
310    *}
311
312 function SDL_GetVideoDriver(index: SInt32): PAnsiChar cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetVideoDriver' {$ENDIF} {$ENDIF};
313
314   {**
315    *  Initialize the video subsystem, optionally specifying a video driver.
316    *
317    *  driver_name Initialize a specific driver by name, or nil for the
318    *  default video driver.
319    *
320    *  0 on success, -1 on error
321    *
322    *  This function initializes the video subsystem; setting up a connection
323    *  to the window manager, etc, and determines the available display modes
324    *  and pixel formats, but does not initialize a window or graphics mode.
325    *
326    *  SDL_VideoQuit()
327    *}
328
329 function SDL_VideoInit(const driver_name: PAnsiChar): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_VideoInit' {$ENDIF} {$ENDIF};
330
331   {**
332    *  Shuts down the video subsystem.
333    *
334    *  function closes all windows, and restores the original video mode.
335    *  
336    *  SDL_VideoInit()
337    *}
338 procedure SDL_VideoQuit cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_VideoQuit' {$ENDIF} {$ENDIF};
339
340   {**
341    *  Returns the name of the currently initialized video driver.
342    *
343    *  The name of the current video driver or nil if no driver
344    *  has been initialized
345    *
346    *  SDL_GetNumVideoDrivers()
347    *  SDL_GetVideoDriver()
348    *}
349
350 function SDL_GetCurrentVideoDriver: PAnsiChar cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetCurrentVideoDriver' {$ENDIF} {$ENDIF};
351
352   {**
353    *  Returns the number of available video displays.
354    *  
355    *  SDL_GetDisplayBounds()
356    *}
357
358 function SDL_GetNumVideoDisplays: SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetNumVideoDisplays' {$ENDIF} {$ENDIF};
359
360   {**
361    *  Get the name of a display in UTF-8 encoding
362    *
363    *  The name of a display, or nil for an invalid display index.
364    *  
365    *  SDL_GetNumVideoDisplays()
366    *}
367
368 function SDL_GetDisplayName(displayIndex: SInt32): PAnsiChar cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetDisplayName' {$ENDIF} {$ENDIF};
369
370   {**
371    *  Get the desktop area represented by a display, with the primary
372    *  display located at 0,0
373    *
374    *  0 on success, or -1 if the index is out of range.
375    *
376    *  SDL_GetNumVideoDisplays()
377    *}
378
379 function SDL_GetDisplayBounds(displayIndex: SInt32; rect: PSDL_Rect): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetDisplayBounds' {$ENDIF} {$ENDIF};
380
381   {**
382    *  Returns the number of available display modes.
383    *
384    *  SDL_GetDisplayMode()
385    *}
386
387 function SDL_GetNumDisplayModes(displayIndex: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetNumDisplayModes' {$ENDIF} {$ENDIF};
388
389   {**
390    *  Fill in information about a specific display mode.
391    *
392    *  The display modes are sorted in this priority:
393    *        bits per pixel -> more colors to fewer colors
394    *        width -> largest to smallest
395    *        height -> largest to smallest
396    *        refresh rate -> highest to lowest
397    *
398    *  SDL_GetNumDisplayModes()
399    *}
400
401 function SDL_GetDisplayMode(displayIndex: SInt32; modeIndex: SInt32; mode: PSDL_DisplayMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetDisplayMode' {$ENDIF} {$ENDIF};
402
403   {**
404    *  Fill in information about the desktop display mode.
405    *}
406
407 function SDL_GetDesktopDisplayMode(displayIndex: SInt32; mode: PSDL_DisplayMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetDesktopDisplayMode' {$ENDIF} {$ENDIF};
408
409   {**
410    *  Fill in information about the current display mode.
411    *}
412
413 function SDL_GetCurrentDisplayMode(displayIndex: SInt32; mode: PSDL_DisplayMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetCurrentDisplayIndex' {$ENDIF} {$ENDIF};
414
415   {**
416    *  Get the closest match to the requested display mode.
417    *
418    *  mode The desired display mode
419    *  closest A pointer to a display mode to be filled in with the closest
420    *  match of the available display modes.
421    *
422    *  The passed in value closest, or nil if no matching video mode
423    *  was available.
424    *  
425    *  The available display modes are scanned, and closest is filled in with the
426    *  closest mode matching the requested mode and returned.  The mode format and 
427    *  refresh_rate default to the desktop mode if they are 0.  The modes are
428    *  scanned with size being first priority, format being second priority, and 
429    *  finally checking the refresh_rate.  If all the available modes are too
430    *  small, then nil is returned.
431    *
432    *  SDL_GetNumDisplayModes()
433    *  SDL_GetDisplayMode()
434    *}
435
436 function SDL_GetClosestDisplayMode(displayIndex: SInt32; const mode: PSDL_DisplayMode; closest: PSDL_DisplayMode): PSDL_DisplayMode cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetClosestDisplayMode' {$ENDIF} {$ENDIF};
437
438   {**
439    *  Get the display index associated with a window.
440    *  
441    *  the display index of the display containing the center of the
442    *  window, or -1 on error.
443    *}
444
445 function SDL_GetWindowDisplayIndex(window: PSDL_Window): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowDisplayIndex' {$ENDIF} {$ENDIF};
446
447   {**
448    *  Set the display mode used when a fullscreen window is visible.
449    *
450    *  By default the window's dimensions and the desktop format and refresh rate
451    *  are used.
452    *  
453    *  mode The mode to use, or nil for the default mode.
454    *  
455    *  0 on success, or -1 if setting the display mode failed.
456    *  
457    *  SDL_GetWindowDisplayMode()
458    *  SDL_SetWindowFullscreen()
459    *}
460
461 function SDL_SetWindowDisplayMode(window: PSDL_Window; const mode: PSDL_DisplayMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowDisplayMode' {$ENDIF} {$ENDIF};
462
463   {**
464    *  Fill in information about the display mode used when a fullscreen
465    *  window is visible.
466    *
467    *  SDL_SetWindowDisplayMode()
468    *  SDL_SetWindowFullscreen()
469    *}
470
471 function SDL_GetWindowDisplayMode(window: PSDL_Window; mode: PSDL_DisplayMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowDisplayMode' {$ENDIF} {$ENDIF};
472
473   {**
474    *  Get the pixel format associated with the window.
475    *}
476
477 function SDL_GetWindowPixelFormat(window: PSDL_Window): UInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowPixelFormat' {$ENDIF} {$ENDIF};
478
479   {**
480    *  Create a window with the specified position, dimensions, and flags.
481    *
482    *  title The title of the window, in UTF-8 encoding.
483    *  x     The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
484    *               ::SDL_WINDOWPOS_UNDEFINED.
485    *  y     The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
486    *               ::SDL_WINDOWPOS_UNDEFINED.
487    *  w     The width of the window.
488    *  h     The height of the window.
489    *  flags The flags for the window, a mask of any of the following:
490    *               ::SDL_WINDOW_FULLSCREEN, ::SDL_WINDOW_OPENGL, 
491    *               ::SDL_WINDOW_SHOWN,      ::SDL_WINDOW_BORDERLESS,
492    *               ::SDL_WINDOW_RESIZABLE,  ::SDL_WINDOW_MAXIMIZED, 
493    *               ::SDL_WINDOW_MINIMIZED,  ::SDL_WINDOW_INPUT_GRABBED.
494    *
495    *  The id of the window created, or zero if window creation failed.
496    *
497    *  SDL_DestroyWindow()
498    *}
499
500 function SDL_CreateWindow(const title: PAnsiChar; x: SInt32; y: SInt32; w: SInt32; h: SInt32; flags: UInt32): PSDL_Window cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_CreateWindow' {$ENDIF} {$ENDIF};
501
502   {**
503    *  Create an SDL window from an existing native window.
504    *  
505    *  data A pointer to driver-dependent window creation data
506    *  
507    *  The id of the window created, or zero if window creation failed.
508    *
509    *  SDL_DestroyWindow()
510    *}
511
512 function SDL_CreateWindowFrom(const data: Pointer): PSDL_Window cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_CreateWindowFrom' {$ENDIF} {$ENDIF};
513
514   {**
515    *  Get the numeric ID of a window, for logging purposes.
516    *}
517
518 function SDL_GetWindowID(window: PSDL_Window): UInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowID' {$ENDIF} {$ENDIF};
519
520   {**
521    *  Get a window from a stored ID, or nil if it doesn't exist.
522    *}
523
524 function SDL_GetWindowFromID(id: UInt32): PSDL_Window cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowFromID' {$ENDIF} {$ENDIF};
525
526   {**
527    *  Get the window flags.
528    *}
529
530 function SDL_GetWindowFlags(window: PSDL_Window): UInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowFlags' {$ENDIF} {$ENDIF};
531
532   {**
533    *  Set the title of a window, in UTF-8 format.
534    *  
535    *  SDL_GetWindowTitle()
536    *}
537
538 procedure SDL_SetWindowTitle(window: PSDL_Window; const title: PAnsiChar) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowTitle' {$ENDIF} {$ENDIF};
539
540   {**
541    *  Get the title of a window, in UTF-8 format.
542    *
543    *  SDL_SetWindowTitle()
544    *}
545
546 function SDL_GetWindowTitle(window: PSDL_Window): PAnsiChar cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowTitle' {$ENDIF} {$ENDIF};
547
548   {**
549    *  Set the icon for a window.
550    *
551    *  icon The icon for the window.
552    *}
553
554 procedure SDL_SetWindowIcon(window: PSDL_Window; icon: PSDL_Surface) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowIcon' {$ENDIF} {$ENDIF};
555
556   {**
557    *  Associate an arbitrary named pointer with a window.
558    *  
559    *  window   The window to associate with the pointer.
560    *  name     The name of the pointer.
561    *  userdata The associated pointer.
562    *
563    *  The previous value associated with 'name'
564    *
565    *  The name is case-sensitive.
566    *
567    *  SDL_GetWindowData()
568    *}
569
570 function SDL_SetWindowData(window: PSDL_Window; const name: PAnsiChar; userdata: Pointer): Pointer cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowData' {$ENDIF} {$ENDIF};
571
572   {**
573    *  Retrieve the data pointer associated with a window.
574    *
575    *  window   The window to query.
576    *  name     The name of the pointer.
577    *
578    *  The value associated with 'name'
579    *
580    *  SDL_SetWindowData()
581    *}
582
583 function SDL_GetWindowData(window: PSDL_Window; const name: PAnsiChar): Pointer cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowData' {$ENDIF} {$ENDIF};
584
585   {**
586    *  Set the position of a window.
587    *
588    *  window   The window to reposition.
589    *  x        The x coordinate of the window, SDL_WINDOWPOS_CENTERED, or
590    *                  SDL_WINDOWPOS_UNDEFINED.
591    *  y        The y coordinate of the window, SDL_WINDOWPOS_CENTERED, or
592    *                  SDL_WINDOWPOS_UNDEFINED.
593    *
594    *  The window coordinate origin is the upper left of the display.
595    *
596    *  SDL_GetWindowPosition()
597    *}
598
599 procedure SDL_SetWindowPosition(window: PSDL_Window; x: SInt32; y: SInt32) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowPosition' {$ENDIF} {$ENDIF};
600
601   {**
602    *  Get the position of a window.
603    *
604    *  x        Pointer to variable for storing the x position, may be nil
605    *  y        Pointer to variable for storing the y position, may be nil
606    *
607    *  SDL_SetWindowPosition()
608    *}
609
610 procedure SDL_GetWindowPosition(window: PSDL_Window; x: PInt; y: PInt) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowPosition' {$ENDIF} {$ENDIF};
611
612   {**
613    *  Set the size of a window's client area.
614    *
615    *  w        The width of the window, must be >0
616    *  h        The height of the window, must be >0
617    *
618    *  You can't change the size of a fullscreen window, it automatically
619    *  matches the size of the display mode.
620    *  
621    *  SDL_GetWindowSize()
622    *}
623
624 procedure SDL_SetWindowSize(window: PSDL_Window; w: SInt32; h: SInt32) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowSize' {$ENDIF} {$ENDIF};
625
626   {**
627    *  Get the size of a window's client area.
628    *  
629    *  w        Pointer to variable for storing the width, may be nil
630    *  h        Pointer to variable for storing the height, may be nil
631    *  
632    *  SDL_SetWindowSize()
633    *}
634
635 procedure SDL_GetWindowSize(window: PSDL_Window; w: PInt; h: PInt) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowSize' {$ENDIF} {$ENDIF};
636     
637   {**
638    *  Set the minimum size of a window's client area.
639    *  
640    *  min_w     The minimum width of the window, must be >0
641    *  min_h     The minimum height of the window, must be >0
642    *
643    *  You can't change the minimum size of a fullscreen window, it
644    *  automatically matches the size of the display mode.
645    *
646    *  SDL_GetWindowMinimumSize()
647    *  SDL_SetWindowMaximumSize()
648    *}
649
650 procedure SDL_SetWindowMinimumSize(window: PSDL_Window; min_w: SInt32; min_h: SInt32) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowMinimumSize' {$ENDIF} {$ENDIF};
651     
652   {**
653    *  Get the minimum size of a window's client area.
654    *  
655    *  w        Pointer to variable for storing the minimum width, may be nil
656    *  h        Pointer to variable for storing the minimum height, may be nil
657    *
658    *  SDL_GetWindowMaximumSize()
659    *  SDL_SetWindowMinimumSize()
660    *}
661
662 procedure SDL_GetWindowMinimumSize(window: PSDL_Window; w: PInt; h: PInt) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowMinimumSize' {$ENDIF} {$ENDIF};
663
664   {**
665    *  Set the maximum size of a window's client area.
666    *
667    *  max_w     The maximum width of the window, must be >0
668    *  max_h     The maximum height of the window, must be >0
669    *
670    *  You can't change the maximum size of a fullscreen window, it
671    *  automatically matches the size of the display mode.
672    *
673    *  SDL_GetWindowMaximumSize()
674    *  SDL_SetWindowMinimumSize()
675    *}
676
677 procedure SDL_SetWindowMaximumSize(window: PSDL_Window; max_w: SInt32; max_h: SInt32) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowMaximumSize' {$ENDIF} {$ENDIF};
678
679   {**
680    *  Get the maximum size of a window's client area.
681    *  
682    *  w        Pointer to variable for storing the maximum width, may be nil
683    *  h        Pointer to variable for storing the maximum height, may be nil
684    *
685    *  SDL_GetWindowMinimumSize()
686    *  SDL_SetWindowMaximumSize()
687    *}
688
689 procedure SDL_GetWindowMaximumSize(window: PSDL_Window; w: PInt; h: PInt) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowMaximumSize' {$ENDIF} {$ENDIF};
690
691   {**
692    *  Set the border state of a window.
693    *
694    *  This will add or remove the window's SDL_WINDOW_BORDERLESS flag and
695    *  add or remove the border from the actual window. This is a no-op if the
696    *  window's border already matches the requested state.
697    *
698    *  window The window of which to change the border state.
699    *  bordered SDL_FALSE to remove border, SDL_TRUE to add border.
700    *
701    *  You can't change the border state of a fullscreen window.
702    *  
703    *  SDL_GetWindowFlags()
704    *}
705
706 procedure SDL_SetWindowBordered(window: PSDL_Window; bordered: TSDL_Bool) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowBordered' {$ENDIF} {$ENDIF};
707
708   {**
709    *  Show a window.
710    *  
711    *  SDL_HideWindow()
712    *}
713
714 procedure SDL_ShowWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_ShowWindow' {$ENDIF} {$ENDIF};
715
716   {**
717    *  Hide a window.
718    *  
719    *  SDL_ShowWindow()
720    *}
721
722 procedure SDL_HideWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_HideWindow' {$ENDIF} {$ENDIF};
723
724   {**
725    *  Raise a window above other windows and set the input focus.
726    *}
727
728 procedure SDL_RaiseWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RaiseWindow' {$ENDIF} {$ENDIF};
729
730   {**
731    *  Make a window as large as possible.
732    *  
733    *  SDL_RestoreWindow()
734    *}
735
736 procedure SDL_MaximizeWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_MaximizeWindow' {$ENDIF} {$ENDIF};
737
738   {**
739    *  Minimize a window to an iconic representation.
740    *
741    *  SDL_RestoreWindow()
742    *}
743
744 procedure SDL_MinimizeWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_MinimizeWindow' {$ENDIF} {$ENDIF};
745
746   {**
747    *  Restore the size and position of a minimized or maximized window.
748    *  
749    *  SDL_MaximizeWindow()
750    *  SDL_MinimizeWindow()
751    *}
752
753 procedure SDL_RestoreWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RestoreWindow' {$ENDIF} {$ENDIF};
754
755   {**
756    *  Set a window's fullscreen state.
757    *  
758    *  0 on success, or -1 if setting the display mode failed.
759    *  
760    *  SDL_SetWindowDisplayMode()
761    *  SDL_GetWindowDisplayMode()
762    *}
763
764 function SDL_SetWindowFullscreen(window: PSDL_Window; flags: UInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowFullscreen' {$ENDIF} {$ENDIF};
765
766   {**
767    *  Get the SDL surface associated with the window.
768    *
769    *  The window's framebuffer surface, or nil on error.
770    *
771    *  A new surface will be created with the optimal format for the window,
772    *  if necessary. This surface will be freed when the window is destroyed.
773    *
774    *  You may not combine this with 3D or the rendering API on this window.
775    *
776    *  SDL_UpdateWindowSurface()
777    *  SDL_UpdateWindowSurfaceRects()
778    *}
779
780 function SDL_GetWindowSurface(window: PSDL_Window): PSDL_Surface cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowSurface' {$ENDIF} {$ENDIF};
781
782   {**
783    *  Copy the window surface to the screen.
784    *
785    *  0 on success, or -1 on error.
786    *
787    *  SDL_GetWindowSurface()
788    *  SDL_UpdateWindowSurfaceRects()
789    *}
790
791 function SDL_UpdateWindowSurface(window: PSDL_Window): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_UpdateWindowSurface' {$ENDIF} {$ENDIF};
792
793   {**
794    *  Copy a number of rectangles on the window surface to the screen.
795    *
796    *  0 on success, or -1 on error.
797    *
798    *  SDL_GetWindowSurface()
799    *  SDL_UpdateWindowSurfaceRect()
800    *}
801
802 function SDL_UpdateWindowSurfaceRects(window: PSDL_Window; rects: PSDL_Rect; numrects: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_UpdateWindowSurfaceRects' {$ENDIF} {$ENDIF};
803
804   {**
805    *  Set a window's input grab mode.
806    *  
807    *  grabbed This is SDL_TRUE to grab input, and SDL_FALSE to release input.
808    *  
809    *  SDL_GetWindowGrab()
810    *}
811
812 procedure SDL_SetWindowGrab(window: PSDL_Window; grabbed: TSDL_Bool) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowGrab' {$ENDIF} {$ENDIF};
813
814   {**
815    *  Get a window's input grab mode.
816    *  
817    *  This returns SDL_TRUE if input is grabbed, and SDL_FALSE otherwise.
818    *
819    *  SDL_SetWindowGrab()
820    *}
821
822 function SDL_GetWindowGrab(window: PSDL_Window): TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowGrab' {$ENDIF} {$ENDIF};
823
824   {**
825    *  Set the brightness (gamma correction) for a window.
826    *
827    *  0 on success, or -1 if setting the brightness isn't supported.
828    *
829    *  SDL_GetWindowBrightness()
830    *  SDL_SetWindowGammaRamp()
831    *}
832
833 function SDL_SetWindowBrightness(window: PSDL_Window; brightness: Float): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowBrightness' {$ENDIF} {$ENDIF};
834
835   {**
836    *  Get the brightness (gamma correction) for a window.
837    *  
838    *  The last brightness value passed to SDL_SetWindowBrightness()
839    *
840    *  SDL_SetWindowBrightness()
841    *}
842
843 function SDL_GetWindowBrightness(window: PSDL_Window): Float cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowBrightness' {$ENDIF} {$ENDIF};
844
845   {**
846    *  Set the gamma ramp for a window.
847    *  
848    *  red The translation table for the red channel, or nil.
849    *  green The translation table for the green channel, or nil.
850    *  blue The translation table for the blue channel, or nil.
851    *
852    *  0 on success, or -1 if gamma ramps are unsupported.
853    *  
854    *  Set the gamma translation table for the red, green, and blue channels
855    *  of the video hardware.  Each table is an array of 256 16-bit quantities,
856    *  representing a mapping between the input and output for that channel.
857    *  The input is the index into the array, and the output is the 16-bit
858    *  gamma value at that index, scaled to the output color precision.
859    *
860    *  SDL_GetWindowGammaRamp()
861    *}
862
863 function SDL_SetWindowGammaRamp(window: PSDL_Window; const red: PUInt16; const green: PUInt16; const blue: PUInt16): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowGammaRamp' {$ENDIF} {$ENDIF};
864
865   {**
866    *  Get the gamma ramp for a window.
867    *
868    *  red   A pointer to a 256 element array of 16-bit quantities to hold
869    *        the translation table for the red channel, or nil.
870    *  green A pointer to a 256 element array of 16-bit quantities to hold
871    *        the translation table for the green channel, or nil.
872    *  blue  A pointer to a 256 element array of 16-bit quantities to hold
873    *        the translation table for the blue channel, or nil.
874    *   
875    *  0 on success, or -1 if gamma ramps are unsupported.
876    *
877    *  SDL_SetWindowGammaRamp()
878    *}
879
880 function SDL_GetWindowGammaRamp(window: PSDL_Window; red: PUInt16; green: PUInt16; blue: PUInt16): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowGammaRamp' {$ENDIF} {$ENDIF};
881
882   {**
883    *  Destroy a window.
884    *}
885
886 procedure SDL_DestroyWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_DestroyWindow' {$ENDIF} {$ENDIF};
887
888   {**
889    *  Returns whether the screensaver is currently enabled (default on).
890    *  
891    *  SDL_EnableScreenSaver()
892    *  SDL_DisableScreenSaver()
893    *}
894
895 function SDL_IsScreenSaverEnabled: TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_IsScreenSaverEnabled' {$ENDIF} {$ENDIF};
896
897   {**
898    *  Allow the screen to be blanked by a screensaver
899    *
900    *  SDL_IsScreenSaverEnabled()
901    *  SDL_DisableScreenSaver()
902    *}
903
904 procedure SDL_EnableScreenSaver cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_EnableScreenSaver' {$ENDIF} {$ENDIF};
905
906   {**
907    *  Prevent the screen from being blanked by a screensaver
908    *
909    *  SDL_IsScreenSaverEnabled()
910    *  SDL_EnableScreenSaver()
911    *}
912
913 procedure SDL_DisableScreenSaver cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_DisableScreenSaver' {$ENDIF} {$ENDIF};
914
915   {**
916    *  OpenGL support functions
917    *}
918
919   {**
920    *  Dynamically load an OpenGL library.
921    *
922    *  path The platform dependent OpenGL library name, or nil to open the
923    *              default OpenGL library.
924    *
925    *  0 on success, or -1 if the library couldn't be loaded.
926    *
927    *  This should be done after initializing the video driver, but before
928    *  creating any OpenGL windows.  If no OpenGL library is loaded, the default
929    *  library will be loaded upon creation of the first OpenGL window.
930    *
931    *  If you do this, you need to retrieve all of the GL functions used in
932    *  your program from the dynamic library using SDL_GL_GetProcAddress().
933    *
934    *  SDL_GL_GetProcAddress()
935    *  SDL_GL_UnloadLibrary()
936    *}
937
938 function SDL_GL_LoadLibrary(const path: PAnsiChar): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_LoadLibrary' {$ENDIF} {$ENDIF};
939
940   {**
941    *  Get the address of an OpenGL function.
942    *}
943
944 function SDL_GL_GetProcAddress(const proc: PAnsiChar): Pointer cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetProcAddress' {$ENDIF} {$ENDIF};
945
946   {**
947    *  Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary().
948    *
949    *  SDL_GL_LoadLibrary()
950    *}
951
952 procedure SDL_GL_UnloadLibrary cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_UnloadLibrary' {$ENDIF} {$ENDIF};
953
954   {**
955    *  Return true if an OpenGL extension is supported for the current
956    *  context.
957    *}
958
959 function SDL_GL_ExtensionSupported(const extension: PAnsiChar): TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_ExtensionSupported' {$ENDIF} {$ENDIF};
960
961   {**
962    *  Set an OpenGL window attribute before window creation.
963    *}
964
965 function SDL_GL_SetAttribute(attr: TSDL_GLattr; value: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_SetAttribute' {$ENDIF} {$ENDIF};
966
967   {**
968    *  Get the actual value for an attribute from the current context.
969    *}
970
971 function SDL_GL_GetAttribute(attr: TSDL_GLattr; value: PInt): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetAttribute' {$ENDIF} {$ENDIF};
972
973   {**
974    *  Create an OpenGL context for use with an OpenGL window, and make it
975    *  current.
976    *
977    *  SDL_GL_DeleteContext()
978    *}
979
980 function SDL_GL_CreateContext(window: PSDL_Window): TSDL_GLContext cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_CreateContext' {$ENDIF} {$ENDIF};
981
982   {**
983    *  Set up an OpenGL context for rendering into an OpenGL window.
984    *
985    *  The context must have been created with a compatible window.
986    *}
987
988 function SDL_GL_MakeCurrent(window: PSDL_Window; context: TSDL_GLContext): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_MakeCurrent' {$ENDIF} {$ENDIF};
989
990   {**
991    *  Get the currently active OpenGL window.
992    *}
993 function SDL_GL_GetCurrentWindow: PSDL_Window cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetCurrentWindow' {$ENDIF} {$ENDIF};
994
995   {**
996    *  Get the currently active OpenGL context.
997    *}
998 function SDL_GL_GetCurrentContext: TSDL_GLContext cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetCurrentContext' {$ENDIF} {$ENDIF};
999
1000   {**
1001    *  Set the swap interval for the current OpenGL context.
1002    *  
1003    *  interval 0 for immediate updates, 1 for updates synchronized with the
1004    *  vertical retrace. If the system supports it, you may
1005    *  specify -1 to allow late swaps to happen immediately
1006    *  instead of waiting for the next retrace.
1007    *
1008    *  0 on success, or -1 if setting the swap interval is not supported.
1009    *
1010    *  SDL_GL_GetSwapInterval()
1011    *}
1012
1013 function SDL_GL_SetSwapInterval(interval: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_SetSwapInterval' {$ENDIF} {$ENDIF};
1014
1015   {**
1016    *  Get the swap interval for the current OpenGL context.
1017    *
1018    *  0 if there is no vertical retrace synchronization, 1 if the buffer
1019    *  swap is synchronized with the vertical retrace, and -1 if late
1020    *  swaps happen immediately instead of waiting for the next retrace.
1021    *  If the system can't determine the swap interval, or there isn't a
1022    *  valid current context, this will return 0 as a safe default.
1023    *  
1024    *  SDL_GL_SetSwapInterval()
1025    *}
1026
1027 function SDL_GL_GetSwapInterval: SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetSwapInterval' {$ENDIF} {$ENDIF};
1028
1029   {**
1030    *  Swap the OpenGL buffers for a window, if double-buffering is
1031    *  supported.
1032    *}
1033
1034 procedure SDL_GL_SwapWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_SwapWindow' {$ENDIF} {$ENDIF};
1035
1036   {**
1037    *  Delete an OpenGL context.
1038    *  
1039    *  SDL_GL_CreateContext()
1040    *}
1041
1042 procedure SDL_GL_DeleteContext(context: TSDL_GLContext) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_DeleteContext' {$ENDIF} {$ENDIF};
1043
1044   {*OpenGL support functions*}