4 * The structure that defines a display mode
6 * SDL_GetNumDisplayModes()
8 * SDL_GetDesktopDisplayMode()
9 * SDL_GetCurrentDisplayMode()
10 * SDL_GetClosestDisplayMode()
11 * SDL_SetWindowDisplayMode()
12 * SDL_GetWindowDisplayMode()
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 *}
24 {* Define the SDL window-shaper structure *}
25 PSDL_WindowShaper = ^TSDL_WindowShaper;
26 TSDL_WindowShaper = record
27 {* The window associated with the shaper *}
30 {* The user's specified coordinates for the window, for once we give it a shape. *}
33 {* The parameters for shape calculation. *}
34 mode: TSDL_WindowShapeMode;
36 {* Has this window been assigned a shape? *}
42 PSDL_WindowUserData = ^TSDL_WindowUserData;
43 TSDL_WindowUserData = record
46 next: PSDL_WindowUserData;
49 {* Define the SDL window structure, corresponding to toplevel windows *}
61 {* Stored position and size for windowed mode * }
64 fullscreen_mode: TSDL_DisplayMode;
68 saved_gamma: PUInt16; {* (just offset into gamma) *}
70 surface: PSDL_Surface;
71 surface_valid: TSDL_Bool;
73 shaper: PSDL_WindowShaper;
75 data: PSDL_WindowUserData;
84 * Get the shape parameters of a shaped window.
86 * window The shaped window whose parameters should be retrieved.
87 * shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape.
89 * 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode
90 * data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if
91 * the SDL_Window* given is a shapeable window currently lacking a shape.
96 function SDL_GetShapedWindowMode(window: PSDL_Window; shape_mode: TSDL_WindowShapeMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetShapedWindowMode' {$ENDIF} {$ENDIF};
99 * Set the shape and parameters of a shaped window.
101 * window The shaped window whose parameters should be set.
102 * shape A surface encoding the desired shape for the window.
103 * shape_mode The parameters to set for the shaped window.
105 * 0 on success, SDL_INVALID_SHAPE_ARGUMENT on invalid an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW
106 * if the SDL_Window* given does not reference a valid shaped window.
108 * SDL_WindowShapeMode
109 * SDL_GetShapedWindowMode.
111 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};
114 * Create a window that can be shaped with the specified position, dimensions, and flags.
116 * title The title of the window, in UTF-8 encoding.
117 * x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
118 * ::SDL_WINDOWPOS_UNDEFINED.
119 * y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
120 * ::SDL_WINDOWPOS_UNDEFINED.
121 * w The width of the window.
122 * h The height of the window.
123 * flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following:
124 * SDL_WINDOW_OPENGL, SDL_WINDOW_INPUT_GRABBED,
125 * SDL_WINDOW_SHOWN, SDL_WINDOW_RESIZABLE,
126 * SDL_WINDOW_MAXIMIZED, SDL_WINDOW_MINIMIZED,
127 * SDL_WINDOW_BORDERLESS is always set, and SDL_WINDOW_FULLSCREEN is always unset.
129 * The window created, or NULL if window creation failed.
131 * SDL_DestroyWindow()
133 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};
136 * Return whether the given window is a shaped window.
138 * window The window to query for being shaped.
140 * SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL.
141 * SDL_CreateShapedWindow
143 function SDL_IsShapedWindow(window: PSDL_Window): TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_IsShapedWindow' {$ENDIF} {$ENDIF};
146 * The type used to identify a window
149 * SDL_CreateWindowFrom()
150 * SDL_DestroyWindow()
151 * SDL_GetWindowData()
152 * SDL_GetWindowFlags()
153 * SDL_GetWindowGrab()
154 * SDL_GetWindowPosition()
155 * SDL_GetWindowSize()
156 * SDL_GetWindowTitle()
158 * SDL_MaximizeWindow()
159 * SDL_MinimizeWindow()
161 * SDL_RestoreWindow()
162 * SDL_SetWindowData()
163 * SDL_SetWindowFullscreen()
164 * SDL_SetWindowGrab()
165 * SDL_SetWindowIcon()
166 * SDL_SetWindowPosition()
167 * SDL_SetWindowSize()
168 * SDL_SetWindowBordered()
169 * SDL_SetWindowTitle()
175 * The flags on a window
177 * SDL_GetWindowFlags()
180 SDL_WINDOW_FULLSCREEN = $00000001; {**< fullscreen window *}
181 SDL_WINDOW_OPENGL = $00000002; {**< window usable with OpenGL context *}
182 SDL_WINDOW_SHOWN = $00000004; {**< window is visible *}
183 SDL_WINDOW_HIDDEN = $00000008; {**< window is not visible *}
184 SDL_WINDOW_BORDERLESS = $00000010; {**< no window decoration *}
185 SDL_WINDOW_RESIZABLE = $00000020; {**< window can be resized *}
186 SDL_WINDOW_MINIMIZED = $00000040; {**< window is minimized *}
187 SDL_WINDOW_MAXIMIZED = $00000080; {**< window is maximized *}
188 SDL_WINDOW_INPUT_GRABBED = $00000100; {**< window has grabbed input focus *}
189 SDL_WINDOW_INPUT_FOCUS = $00000200; {**< window has input focus *}
190 SDL_WINDOW_MOUSE_FOCUS = $00000400; {**< window has mouse focus *}
191 SDL_WINDOW_FULLSCREEN_DESKTOP = SDL_WINDOW_FULLSCREEN or $00001000;
192 SDL_WINDOW_FOREIGN = $00000800; {**< window not created by SDL *}
193 SDL_WINDOW_ALLOW_HIGHDPI = $00002000; {**< window should be created in high-DPI mode if supported *}
196 TSDL_WindowFlags = DWord;
198 function SDL_WindowPos_IsUndefined(X: Variant): Variant;
199 function SDL_WindowPos_IsCentered(X: Variant): Variant;
203 * Used to indicate that you don't care what the window position is.
206 SDL_WINDOWPOS_UNDEFINED_MASK = $1FFF0000;
207 SDL_WINDOWPOS_UNDEFINED = SDL_WINDOWPOS_UNDEFINED_MASK or 0;
211 * Used to indicate that the window position should be centered.
214 SDL_WINDOWPOS_CENTERED_MASK = $2FFF0000;
215 SDL_WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED_MASK or 0;
218 * Event subtype for window events
221 SDL_WINDOWEVENT_NONE = 0; {**< Never used *}
222 SDL_WINDOWEVENT_SHOWN = 1; {**< Window has been shown *}
223 SDL_WINDOWEVENT_HIDDEN = 2; {**< Window has been hidden *}
224 SDL_WINDOWEVENT_EXPOSED = 3; {**< Window has been exposed and should be redrawn *}
225 SDL_WINDOWEVENT_MOVED = 4; {**< Window has been moved to data1; data2 *}
226 SDL_WINDOWEVENT_RESIZED = 5; {**< Window has been resized to data1xdata2 *}
227 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. *}
228 SDL_WINDOWEVENT_MINIMIZED = 7; {**< Window has been minimized *}
229 SDL_WINDOWEVENT_MAXIMIZED = 8; {**< Window has been maximized *}
230 SDL_WINDOWEVENT_RESTORED = 9; {**< Window has been restored to normal size and position *}
231 SDL_WINDOWEVENT_ENTER = 10; {**< Window has gained mouse focus *}
232 SDL_WINDOWEVENT_LEAVE = 11; {**< Window has lost mouse focus *}
233 SDL_WINDOWEVENT_FOCUS_GAINED = 12; {**< Window has gained keyboard focus *}
234 SDL_WINDOWEVENT_FOCUS_LOST = 13; {**< Window has lost keyboard focus *}
235 SDL_WINDOWEVENT_CLOSE = 14; {**< The window manager requests that the window be closed *}
238 TSDL_WindowEventID = DWord;
241 * An opaque handle to an OpenGL context.
244 TSDL_GLContext = Pointer;
247 * OpenGL configuration attributes
252 SDL_GL_GREEN_SIZE = 1;
253 SDL_GL_BLUE_SIZE = 2;
254 SDL_GL_ALPHA_SIZE = 3;
255 SDL_GL_BUFFER_SIZE = 4;
256 SDL_GL_DOUBLEBUFFER = 5;
257 SDL_GL_DEPTH_SIZE = 6;
258 SDL_GL_STENCIL_SIZE = 7;
259 SDL_GL_ACCUM_RED_SIZE = 8;
260 SDL_GL_ACCUM_GREEN_SIZE = 9;
261 SDL_GL_ACCUM_BLUE_SIZE = 10;
262 SDL_GL_ACCUM_ALPHA_SIZE = 11;
264 SDL_GL_MULTISAMPLEBUFFERS = 13;
265 SDL_GL_MULTISAMPLESAMPLES = 14;
266 SDL_GL_ACCELERATED_VISUAL = 15;
267 SDL_GL_RETAINED_BACKING = 16;
268 SDL_GL_CONTEXT_MAJOR_VERSION = 17;
269 SDL_GL_CONTEXT_MINOR_VERSION = 18;
270 SDL_GL_CONTEXT_EGL = 19;
271 SDL_GL_CONTEXT_FLAGS = 20;
272 SDL_GL_CONTEXT_PROFILE_MASK = 21;
273 SDL_GL_SHARE_WITH_CURRENT_CONTEXT = 22;
274 SDL_GL_FRAMEBUFFER_SRGB_CAPABLE = 23;
280 SDL_GL_CONTEXT_PROFILE_CORE = $0001;
281 SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = $0002;
282 SDL_GL_CONTEXT_PROFILE_ES = $0004;
285 TSDL_GLprofile = DWord;
288 SDL_GL_CONTEXT_DEBUG_FLAG = $0001;
289 SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = $0002;
290 SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = $0004;
291 SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = $0008;
294 TSDL_GLcontextFlag = DWord;
296 {* Function prototypes *}
299 * Get the number of video drivers compiled into SDL
301 * SDL_GetVideoDriver()
304 function SDL_GetNumVideoDrivers: SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetNumVideoDrivers' {$ENDIF} {$ENDIF};
307 * Get the name of a built in video driver.
309 * The video drivers are presented in the order in which they are
310 * normally checked during initialization.
312 * SDL_GetNumVideoDrivers()
315 function SDL_GetVideoDriver(index: SInt32): PAnsiChar cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetVideoDriver' {$ENDIF} {$ENDIF};
318 * Initialize the video subsystem, optionally specifying a video driver.
320 * driver_name Initialize a specific driver by name, or nil for the
321 * default video driver.
323 * 0 on success, -1 on error
325 * This function initializes the video subsystem; setting up a connection
326 * to the window manager, etc, and determines the available display modes
327 * and pixel formats, but does not initialize a window or graphics mode.
332 function SDL_VideoInit(const driver_name: PAnsiChar): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_VideoInit' {$ENDIF} {$ENDIF};
335 * Shuts down the video subsystem.
337 * function closes all windows, and restores the original video mode.
341 procedure SDL_VideoQuit cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_VideoQuit' {$ENDIF} {$ENDIF};
344 * Returns the name of the currently initialized video driver.
346 * The name of the current video driver or nil if no driver
347 * has been initialized
349 * SDL_GetNumVideoDrivers()
350 * SDL_GetVideoDriver()
353 function SDL_GetCurrentVideoDriver: PAnsiChar cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetCurrentVideoDriver' {$ENDIF} {$ENDIF};
356 * Returns the number of available video displays.
358 * SDL_GetDisplayBounds()
361 function SDL_GetNumVideoDisplays: SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetNumVideoDisplays' {$ENDIF} {$ENDIF};
364 * Get the name of a display in UTF-8 encoding
366 * The name of a display, or nil for an invalid display index.
368 * SDL_GetNumVideoDisplays()
371 function SDL_GetDisplayName(displayIndex: SInt32): PAnsiChar cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetDisplayName' {$ENDIF} {$ENDIF};
374 * Get the desktop area represented by a display, with the primary
375 * display located at 0,0
377 * 0 on success, or -1 if the index is out of range.
379 * SDL_GetNumVideoDisplays()
382 function SDL_GetDisplayBounds(displayIndex: SInt32; rect: PSDL_Rect): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetDisplayBounds' {$ENDIF} {$ENDIF};
385 * Returns the number of available display modes.
387 * SDL_GetDisplayMode()
390 function SDL_GetNumDisplayModes(displayIndex: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetNumDisplayModes' {$ENDIF} {$ENDIF};
393 * Get the dots/pixels-per-inch for a display.
396 function SDL_GetDisplayDPI(displayIndex: SInt32; ddpi, hdpi, vdpi: PFloat): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetDisplayDPI' {$ENDIF} {$ENDIF};
399 * Fill in information about a specific display mode.
401 * The display modes are sorted in this priority:
402 * bits per pixel -> more colors to fewer colors
403 * width -> largest to smallest
404 * height -> largest to smallest
405 * refresh rate -> highest to lowest
407 * SDL_GetNumDisplayModes()
410 function SDL_GetDisplayMode(displayIndex: SInt32; modeIndex: SInt32; mode: PSDL_DisplayMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetDisplayMode' {$ENDIF} {$ENDIF};
413 * Fill in information about the desktop display mode.
416 function SDL_GetDesktopDisplayMode(displayIndex: SInt32; mode: PSDL_DisplayMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetDesktopDisplayMode' {$ENDIF} {$ENDIF};
419 * Fill in information about the current display mode.
422 function SDL_GetCurrentDisplayMode(displayIndex: SInt32; mode: PSDL_DisplayMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetCurrentDisplayIndex' {$ENDIF} {$ENDIF};
425 * Get the closest match to the requested display mode.
427 * mode The desired display mode
428 * closest A pointer to a display mode to be filled in with the closest
429 * match of the available display modes.
431 * The passed in value closest, or nil if no matching video mode
434 * The available display modes are scanned, and closest is filled in with the
435 * closest mode matching the requested mode and returned. The mode format and
436 * refresh_rate default to the desktop mode if they are 0. The modes are
437 * scanned with size being first priority, format being second priority, and
438 * finally checking the refresh_rate. If all the available modes are too
439 * small, then nil is returned.
441 * SDL_GetNumDisplayModes()
442 * SDL_GetDisplayMode()
445 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};
448 * Get the display index associated with a window.
450 * the display index of the display containing the center of the
451 * window, or -1 on error.
454 function SDL_GetWindowDisplayIndex(window: PSDL_Window): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowDisplayIndex' {$ENDIF} {$ENDIF};
457 * Set the display mode used when a fullscreen window is visible.
459 * By default the window's dimensions and the desktop format and refresh rate
462 * mode The mode to use, or nil for the default mode.
464 * 0 on success, or -1 if setting the display mode failed.
466 * SDL_GetWindowDisplayMode()
467 * SDL_SetWindowFullscreen()
470 function SDL_SetWindowDisplayMode(window: PSDL_Window; const mode: PSDL_DisplayMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowDisplayMode' {$ENDIF} {$ENDIF};
473 * Fill in information about the display mode used when a fullscreen
476 * SDL_SetWindowDisplayMode()
477 * SDL_SetWindowFullscreen()
480 function SDL_GetWindowDisplayMode(window: PSDL_Window; mode: PSDL_DisplayMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowDisplayMode' {$ENDIF} {$ENDIF};
483 * Get the pixel format associated with the window.
486 function SDL_GetWindowPixelFormat(window: PSDL_Window): UInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowPixelFormat' {$ENDIF} {$ENDIF};
489 * Create a window with the specified position, dimensions, and flags.
491 * title The title of the window, in UTF-8 encoding.
492 * x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
493 * ::SDL_WINDOWPOS_UNDEFINED.
494 * y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
495 * ::SDL_WINDOWPOS_UNDEFINED.
496 * w The width of the window.
497 * h The height of the window.
498 * flags The flags for the window, a mask of any of the following:
499 * ::SDL_WINDOW_FULLSCREEN, ::SDL_WINDOW_OPENGL,
500 * ::SDL_WINDOW_SHOWN, ::SDL_WINDOW_BORDERLESS,
501 * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED,
502 * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_INPUT_GRABBED.
504 * The id of the window created, or zero if window creation failed.
506 * SDL_DestroyWindow()
509 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};
512 * Create an SDL window from an existing native window.
514 * data A pointer to driver-dependent window creation data
516 * The id of the window created, or zero if window creation failed.
518 * SDL_DestroyWindow()
521 function SDL_CreateWindowFrom(const data: Pointer): PSDL_Window cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_CreateWindowFrom' {$ENDIF} {$ENDIF};
524 * Get the numeric ID of a window, for logging purposes.
527 function SDL_GetWindowID(window: PSDL_Window): UInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowID' {$ENDIF} {$ENDIF};
530 * Get a window from a stored ID, or nil if it doesn't exist.
533 function SDL_GetWindowFromID(id: UInt32): PSDL_Window cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowFromID' {$ENDIF} {$ENDIF};
536 * Get the window flags.
539 function SDL_GetWindowFlags(window: PSDL_Window): UInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowFlags' {$ENDIF} {$ENDIF};
542 * Set the title of a window, in UTF-8 format.
544 * SDL_GetWindowTitle()
547 procedure SDL_SetWindowTitle(window: PSDL_Window; const title: PAnsiChar) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowTitle' {$ENDIF} {$ENDIF};
550 * Get the title of a window, in UTF-8 format.
552 * SDL_SetWindowTitle()
555 function SDL_GetWindowTitle(window: PSDL_Window): PAnsiChar cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowTitle' {$ENDIF} {$ENDIF};
558 * Set the icon for a window.
560 * icon The icon for the window.
563 procedure SDL_SetWindowIcon(window: PSDL_Window; icon: PSDL_Surface) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowIcon' {$ENDIF} {$ENDIF};
566 * Associate an arbitrary named pointer with a window.
568 * window The window to associate with the pointer.
569 * name The name of the pointer.
570 * userdata The associated pointer.
572 * The previous value associated with 'name'
574 * The name is case-sensitive.
576 * SDL_GetWindowData()
579 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};
582 * Retrieve the data pointer associated with a window.
584 * window The window to query.
585 * name The name of the pointer.
587 * The value associated with 'name'
589 * SDL_SetWindowData()
592 function SDL_GetWindowData(window: PSDL_Window; const name: PAnsiChar): Pointer cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowData' {$ENDIF} {$ENDIF};
595 * Set the position of a window.
597 * window The window to reposition.
598 * x The x coordinate of the window, SDL_WINDOWPOS_CENTERED, or
599 * SDL_WINDOWPOS_UNDEFINED.
600 * y The y coordinate of the window, SDL_WINDOWPOS_CENTERED, or
601 * SDL_WINDOWPOS_UNDEFINED.
603 * The window coordinate origin is the upper left of the display.
605 * SDL_GetWindowPosition()
608 procedure SDL_SetWindowPosition(window: PSDL_Window; x: SInt32; y: SInt32) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowPosition' {$ENDIF} {$ENDIF};
611 * Get the position of a window.
613 * x Pointer to variable for storing the x position, may be nil
614 * y Pointer to variable for storing the y position, may be nil
616 * SDL_SetWindowPosition()
619 procedure SDL_GetWindowPosition(window: PSDL_Window; x: PInt; y: PInt) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowPosition' {$ENDIF} {$ENDIF};
622 * Set the size of a window's client area.
624 * w The width of the window, must be >0
625 * h The height of the window, must be >0
627 * You can't change the size of a fullscreen window, it automatically
628 * matches the size of the display mode.
630 * SDL_GetWindowSize()
633 procedure SDL_SetWindowSize(window: PSDL_Window; w: SInt32; h: SInt32) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowSize' {$ENDIF} {$ENDIF};
636 * Get the size of a window's client area.
638 * w Pointer to variable for storing the width, may be nil
639 * h Pointer to variable for storing the height, may be nil
641 * SDL_SetWindowSize()
644 procedure SDL_GetWindowSize(window: PSDL_Window; w: PInt; h: PInt) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowSize' {$ENDIF} {$ENDIF};
647 * Set the minimum size of a window's client area.
649 * min_w The minimum width of the window, must be >0
650 * min_h The minimum height of the window, must be >0
652 * You can't change the minimum size of a fullscreen window, it
653 * automatically matches the size of the display mode.
655 * SDL_GetWindowMinimumSize()
656 * SDL_SetWindowMaximumSize()
659 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};
662 * Get the minimum size of a window's client area.
664 * w Pointer to variable for storing the minimum width, may be nil
665 * h Pointer to variable for storing the minimum height, may be nil
667 * SDL_GetWindowMaximumSize()
668 * SDL_SetWindowMinimumSize()
671 procedure SDL_GetWindowMinimumSize(window: PSDL_Window; w: PInt; h: PInt) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowMinimumSize' {$ENDIF} {$ENDIF};
674 * Set the maximum size of a window's client area.
676 * max_w The maximum width of the window, must be >0
677 * max_h The maximum height of the window, must be >0
679 * You can't change the maximum size of a fullscreen window, it
680 * automatically matches the size of the display mode.
682 * SDL_GetWindowMaximumSize()
683 * SDL_SetWindowMinimumSize()
686 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};
689 * Get the maximum size of a window's client area.
691 * w Pointer to variable for storing the maximum width, may be nil
692 * h Pointer to variable for storing the maximum height, may be nil
694 * SDL_GetWindowMinimumSize()
695 * SDL_SetWindowMaximumSize()
698 procedure SDL_GetWindowMaximumSize(window: PSDL_Window; w: PInt; h: PInt) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowMaximumSize' {$ENDIF} {$ENDIF};
701 * Set the border state of a window.
703 * This will add or remove the window's SDL_WINDOW_BORDERLESS flag and
704 * add or remove the border from the actual window. This is a no-op if the
705 * window's border already matches the requested state.
707 * window The window of which to change the border state.
708 * bordered SDL_FALSE to remove border, SDL_TRUE to add border.
710 * You can't change the border state of a fullscreen window.
712 * SDL_GetWindowFlags()
715 procedure SDL_SetWindowBordered(window: PSDL_Window; bordered: TSDL_Bool) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowBordered' {$ENDIF} {$ENDIF};
723 procedure SDL_ShowWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_ShowWindow' {$ENDIF} {$ENDIF};
731 procedure SDL_HideWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_HideWindow' {$ENDIF} {$ENDIF};
734 * Raise a window above other windows and set the input focus.
737 procedure SDL_RaiseWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RaiseWindow' {$ENDIF} {$ENDIF};
740 * Make a window as large as possible.
742 * SDL_RestoreWindow()
745 procedure SDL_MaximizeWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_MaximizeWindow' {$ENDIF} {$ENDIF};
748 * Minimize a window to an iconic representation.
750 * SDL_RestoreWindow()
753 procedure SDL_MinimizeWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_MinimizeWindow' {$ENDIF} {$ENDIF};
756 * Restore the size and position of a minimized or maximized window.
758 * SDL_MaximizeWindow()
759 * SDL_MinimizeWindow()
762 procedure SDL_RestoreWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RestoreWindow' {$ENDIF} {$ENDIF};
765 * Set a window's fullscreen state.
767 * 0 on success, or -1 if setting the display mode failed.
769 * SDL_SetWindowDisplayMode()
770 * SDL_GetWindowDisplayMode()
773 function SDL_SetWindowFullscreen(window: PSDL_Window; flags: UInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowFullscreen' {$ENDIF} {$ENDIF};
776 * Get the SDL surface associated with the window.
778 * The window's framebuffer surface, or nil on error.
780 * A new surface will be created with the optimal format for the window,
781 * if necessary. This surface will be freed when the window is destroyed.
783 * You may not combine this with 3D or the rendering API on this window.
785 * SDL_UpdateWindowSurface()
786 * SDL_UpdateWindowSurfaceRects()
789 function SDL_GetWindowSurface(window: PSDL_Window): PSDL_Surface cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowSurface' {$ENDIF} {$ENDIF};
792 * Copy the window surface to the screen.
794 * 0 on success, or -1 on error.
796 * SDL_GetWindowSurface()
797 * SDL_UpdateWindowSurfaceRects()
800 function SDL_UpdateWindowSurface(window: PSDL_Window): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_UpdateWindowSurface' {$ENDIF} {$ENDIF};
803 * Copy a number of rectangles on the window surface to the screen.
805 * 0 on success, or -1 on error.
807 * SDL_GetWindowSurface()
808 * SDL_UpdateWindowSurfaceRect()
811 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};
814 * Set a window's input grab mode.
816 * grabbed This is SDL_TRUE to grab input, and SDL_FALSE to release input.
818 * SDL_GetWindowGrab()
821 procedure SDL_SetWindowGrab(window: PSDL_Window; grabbed: TSDL_Bool) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowGrab' {$ENDIF} {$ENDIF};
824 * Get a window's input grab mode.
826 * This returns SDL_TRUE if input is grabbed, and SDL_FALSE otherwise.
828 * SDL_SetWindowGrab()
831 function SDL_GetWindowGrab(window: PSDL_Window): TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowGrab' {$ENDIF} {$ENDIF};
834 * Set the brightness (gamma correction) for a window.
836 * 0 on success, or -1 if setting the brightness isn't supported.
838 * SDL_GetWindowBrightness()
839 * SDL_SetWindowGammaRamp()
842 function SDL_SetWindowBrightness(window: PSDL_Window; brightness: Float): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowBrightness' {$ENDIF} {$ENDIF};
845 * Get the brightness (gamma correction) for a window.
847 * The last brightness value passed to SDL_SetWindowBrightness()
849 * SDL_SetWindowBrightness()
852 function SDL_GetWindowBrightness(window: PSDL_Window): Float cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowBrightness' {$ENDIF} {$ENDIF};
855 * Set the gamma ramp for a window.
857 * red The translation table for the red channel, or nil.
858 * green The translation table for the green channel, or nil.
859 * blue The translation table for the blue channel, or nil.
861 * 0 on success, or -1 if gamma ramps are unsupported.
863 * Set the gamma translation table for the red, green, and blue channels
864 * of the video hardware. Each table is an array of 256 16-bit quantities,
865 * representing a mapping between the input and output for that channel.
866 * The input is the index into the array, and the output is the 16-bit
867 * gamma value at that index, scaled to the output color precision.
869 * SDL_GetWindowGammaRamp()
872 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};
875 * Get the gamma ramp for a window.
877 * red A pointer to a 256 element array of 16-bit quantities to hold
878 * the translation table for the red channel, or nil.
879 * green A pointer to a 256 element array of 16-bit quantities to hold
880 * the translation table for the green channel, or nil.
881 * blue A pointer to a 256 element array of 16-bit quantities to hold
882 * the translation table for the blue channel, or nil.
884 * 0 on success, or -1 if gamma ramps are unsupported.
886 * SDL_SetWindowGammaRamp()
889 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};
895 procedure SDL_DestroyWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_DestroyWindow' {$ENDIF} {$ENDIF};
898 * Returns whether the screensaver is currently enabled (default on).
900 * SDL_EnableScreenSaver()
901 * SDL_DisableScreenSaver()
904 function SDL_IsScreenSaverEnabled: TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_IsScreenSaverEnabled' {$ENDIF} {$ENDIF};
907 * Allow the screen to be blanked by a screensaver
909 * SDL_IsScreenSaverEnabled()
910 * SDL_DisableScreenSaver()
913 procedure SDL_EnableScreenSaver cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_EnableScreenSaver' {$ENDIF} {$ENDIF};
916 * Prevent the screen from being blanked by a screensaver
918 * SDL_IsScreenSaverEnabled()
919 * SDL_EnableScreenSaver()
922 procedure SDL_DisableScreenSaver cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_DisableScreenSaver' {$ENDIF} {$ENDIF};
925 * OpenGL support functions
929 * Dynamically load an OpenGL library.
931 * path The platform dependent OpenGL library name, or nil to open the
932 * default OpenGL library.
934 * 0 on success, or -1 if the library couldn't be loaded.
936 * This should be done after initializing the video driver, but before
937 * creating any OpenGL windows. If no OpenGL library is loaded, the default
938 * library will be loaded upon creation of the first OpenGL window.
940 * If you do this, you need to retrieve all of the GL functions used in
941 * your program from the dynamic library using SDL_GL_GetProcAddress().
943 * SDL_GL_GetProcAddress()
944 * SDL_GL_UnloadLibrary()
947 function SDL_GL_LoadLibrary(const path: PAnsiChar): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_LoadLibrary' {$ENDIF} {$ENDIF};
950 * Get the address of an OpenGL function.
953 function SDL_GL_GetProcAddress(const proc: PAnsiChar): Pointer cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetProcAddress' {$ENDIF} {$ENDIF};
956 * Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary().
958 * SDL_GL_LoadLibrary()
961 procedure SDL_GL_UnloadLibrary cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_UnloadLibrary' {$ENDIF} {$ENDIF};
964 * Return true if an OpenGL extension is supported for the current
968 function SDL_GL_ExtensionSupported(const extension: PAnsiChar): TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_ExtensionSupported' {$ENDIF} {$ENDIF};
971 * Reset all previously set OpenGL context attributes to their default values
973 procedure SDL_GL_ResetAttributes(); cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_ResetAttributes' {$ENDIF} {$ENDIF};
976 * Set an OpenGL window attribute before window creation.
979 function SDL_GL_SetAttribute(attr: TSDL_GLattr; value: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_SetAttribute' {$ENDIF} {$ENDIF};
982 * Get the actual value for an attribute from the current context.
985 function SDL_GL_GetAttribute(attr: TSDL_GLattr; value: PInt): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetAttribute' {$ENDIF} {$ENDIF};
988 * Create an OpenGL context for use with an OpenGL window, and make it
991 * SDL_GL_DeleteContext()
994 function SDL_GL_CreateContext(window: PSDL_Window): TSDL_GLContext cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_CreateContext' {$ENDIF} {$ENDIF};
997 * Set up an OpenGL context for rendering into an OpenGL window.
999 * The context must have been created with a compatible window.
1002 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};
1005 * Get the currently active OpenGL window.
1007 function SDL_GL_GetCurrentWindow: PSDL_Window cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetCurrentWindow' {$ENDIF} {$ENDIF};
1010 * Get the currently active OpenGL context.
1012 function SDL_GL_GetCurrentContext: TSDL_GLContext cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetCurrentContext' {$ENDIF} {$ENDIF};
1015 * Set the swap interval for the current OpenGL context.
1017 * interval 0 for immediate updates, 1 for updates synchronized with the
1018 * vertical retrace. If the system supports it, you may
1019 * specify -1 to allow late swaps to happen immediately
1020 * instead of waiting for the next retrace.
1022 * 0 on success, or -1 if setting the swap interval is not supported.
1024 * SDL_GL_GetSwapInterval()
1027 function SDL_GL_SetSwapInterval(interval: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_SetSwapInterval' {$ENDIF} {$ENDIF};
1030 * Get the swap interval for the current OpenGL context.
1032 * 0 if there is no vertical retrace synchronization, 1 if the buffer
1033 * swap is synchronized with the vertical retrace, and -1 if late
1034 * swaps happen immediately instead of waiting for the next retrace.
1035 * If the system can't determine the swap interval, or there isn't a
1036 * valid current context, this will return 0 as a safe default.
1038 * SDL_GL_SetSwapInterval()
1041 function SDL_GL_GetSwapInterval: SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetSwapInterval' {$ENDIF} {$ENDIF};
1044 * Swap the OpenGL buffers for a window, if double-buffering is
1048 procedure SDL_GL_SwapWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_SwapWindow' {$ENDIF} {$ENDIF};
1051 * Delete an OpenGL context.
1053 * SDL_GL_CreateContext()
1056 procedure SDL_GL_DeleteContext(context: TSDL_GLContext) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_DeleteContext' {$ENDIF} {$ENDIF};
1058 {*OpenGL support functions*}