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 *}
60 {* Stored position and size for windowed mode * }
63 fullscreen_mode: TSDL_DisplayMode;
67 saved_gamma: PUInt16; {* (just offset into gamma) *}
69 surface: PSDL_Surface;
70 surface_valid: TSDL_Bool;
72 shaper: PSDL_WindowShaper;
74 data: PSDL_WindowUserData;
83 * Get the shape parameters of a shaped window.
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.
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.
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};
98 * Set the shape and parameters of a shaped window.
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.
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.
107 * SDL_WindowShapeMode
108 * SDL_GetShapedWindowMode.
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};
113 * Create a window that can be shaped with the specified position, dimensions, and flags.
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.
128 * The window created, or NULL if window creation failed.
130 * SDL_DestroyWindow()
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};
135 * Return whether the given window is a shaped window.
137 * window The window to query for being shaped.
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
142 function SDL_IsShapedWindow(window: PSDL_Window): TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_IsShapedWindow' {$ENDIF} {$ENDIF};
145 * The type used to identify a window
148 * SDL_CreateWindowFrom()
149 * SDL_DestroyWindow()
150 * SDL_GetWindowData()
151 * SDL_GetWindowFlags()
152 * SDL_GetWindowGrab()
153 * SDL_GetWindowPosition()
154 * SDL_GetWindowSize()
155 * SDL_GetWindowTitle()
157 * SDL_MaximizeWindow()
158 * SDL_MinimizeWindow()
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()
174 * The flags on a window
176 * SDL_GetWindowFlags()
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 *}
194 TSDL_WindowFlags = DWord;
196 function SDL_WindowPos_IsUndefined(X: Variant): Variant;
197 function SDL_WindowPos_IsCentered(X: Variant): Variant;
201 * Used to indicate that you don't care what the window position is.
204 SDL_WINDOWPOS_UNDEFINED_MASK = $1FFF0000;
205 SDL_WINDOWPOS_UNDEFINED = SDL_WINDOWPOS_UNDEFINED_MASK or 0;
209 * Used to indicate that the window position should be centered.
212 SDL_WINDOWPOS_CENTERED_MASK = $2FFF0000;
213 SDL_WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED_MASK or 0;
216 * Event subtype for window events
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 *}
236 TSDL_WindowEventID = DWord;
239 * An opaque handle to an OpenGL context.
242 TSDL_GLContext = Pointer;
245 * OpenGL configuration attributes
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;
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;
277 SDL_GL_CONTEXT_PROFILE_CORE = $0001;
278 SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = $0002;
279 SDL_GL_CONTEXT_PROFILE_ES = $0004;
282 TSDL_GLprofile = DWord;
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;
291 TSDL_GLcontextFlag = DWord;
293 {* Function prototypes *}
296 * Get the number of video drivers compiled into SDL
298 * SDL_GetVideoDriver()
301 function SDL_GetNumVideoDrivers: SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetNumVideoDrivers' {$ENDIF} {$ENDIF};
304 * Get the name of a built in video driver.
306 * The video drivers are presented in the order in which they are
307 * normally checked during initialization.
309 * SDL_GetNumVideoDrivers()
312 function SDL_GetVideoDriver(index: SInt32): PAnsiChar cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetVideoDriver' {$ENDIF} {$ENDIF};
315 * Initialize the video subsystem, optionally specifying a video driver.
317 * driver_name Initialize a specific driver by name, or nil for the
318 * default video driver.
320 * 0 on success, -1 on error
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.
329 function SDL_VideoInit(const driver_name: PAnsiChar): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_VideoInit' {$ENDIF} {$ENDIF};
332 * Shuts down the video subsystem.
334 * function closes all windows, and restores the original video mode.
338 procedure SDL_VideoQuit cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_VideoQuit' {$ENDIF} {$ENDIF};
341 * Returns the name of the currently initialized video driver.
343 * The name of the current video driver or nil if no driver
344 * has been initialized
346 * SDL_GetNumVideoDrivers()
347 * SDL_GetVideoDriver()
350 function SDL_GetCurrentVideoDriver: PAnsiChar cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetCurrentVideoDriver' {$ENDIF} {$ENDIF};
353 * Returns the number of available video displays.
355 * SDL_GetDisplayBounds()
358 function SDL_GetNumVideoDisplays: SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetNumVideoDisplays' {$ENDIF} {$ENDIF};
361 * Get the name of a display in UTF-8 encoding
363 * The name of a display, or nil for an invalid display index.
365 * SDL_GetNumVideoDisplays()
368 function SDL_GetDisplayName(displayIndex: SInt32): PAnsiChar cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetDisplayName' {$ENDIF} {$ENDIF};
371 * Get the desktop area represented by a display, with the primary
372 * display located at 0,0
374 * 0 on success, or -1 if the index is out of range.
376 * SDL_GetNumVideoDisplays()
379 function SDL_GetDisplayBounds(displayIndex: SInt32; rect: PSDL_Rect): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetDisplayBounds' {$ENDIF} {$ENDIF};
382 * Returns the number of available display modes.
384 * SDL_GetDisplayMode()
387 function SDL_GetNumDisplayModes(displayIndex: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetNumDisplayModes' {$ENDIF} {$ENDIF};
390 * Fill in information about a specific display mode.
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
398 * SDL_GetNumDisplayModes()
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};
404 * Fill in information about the desktop display mode.
407 function SDL_GetDesktopDisplayMode(displayIndex: SInt32; mode: PSDL_DisplayMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetDesktopDisplayMode' {$ENDIF} {$ENDIF};
410 * Fill in information about the current display mode.
413 function SDL_GetCurrentDisplayMode(displayIndex: SInt32; mode: PSDL_DisplayMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetCurrentDisplayIndex' {$ENDIF} {$ENDIF};
416 * Get the closest match to the requested display mode.
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.
422 * The passed in value closest, or nil if no matching video mode
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.
432 * SDL_GetNumDisplayModes()
433 * SDL_GetDisplayMode()
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};
439 * Get the display index associated with a window.
441 * the display index of the display containing the center of the
442 * window, or -1 on error.
445 function SDL_GetWindowDisplayIndex(window: PSDL_Window): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowDisplayIndex' {$ENDIF} {$ENDIF};
448 * Set the display mode used when a fullscreen window is visible.
450 * By default the window's dimensions and the desktop format and refresh rate
453 * mode The mode to use, or nil for the default mode.
455 * 0 on success, or -1 if setting the display mode failed.
457 * SDL_GetWindowDisplayMode()
458 * SDL_SetWindowFullscreen()
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};
464 * Fill in information about the display mode used when a fullscreen
467 * SDL_SetWindowDisplayMode()
468 * SDL_SetWindowFullscreen()
471 function SDL_GetWindowDisplayMode(window: PSDL_Window; mode: PSDL_DisplayMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowDisplayMode' {$ENDIF} {$ENDIF};
474 * Get the pixel format associated with the window.
477 function SDL_GetWindowPixelFormat(window: PSDL_Window): UInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowPixelFormat' {$ENDIF} {$ENDIF};
480 * Create a window with the specified position, dimensions, and flags.
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.
495 * The id of the window created, or zero if window creation failed.
497 * SDL_DestroyWindow()
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};
503 * Create an SDL window from an existing native window.
505 * data A pointer to driver-dependent window creation data
507 * The id of the window created, or zero if window creation failed.
509 * SDL_DestroyWindow()
512 function SDL_CreateWindowFrom(const data: Pointer): PSDL_Window cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_CreateWindowFrom' {$ENDIF} {$ENDIF};
515 * Get the numeric ID of a window, for logging purposes.
518 function SDL_GetWindowID(window: PSDL_Window): UInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowID' {$ENDIF} {$ENDIF};
521 * Get a window from a stored ID, or nil if it doesn't exist.
524 function SDL_GetWindowFromID(id: UInt32): PSDL_Window cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowFromID' {$ENDIF} {$ENDIF};
527 * Get the window flags.
530 function SDL_GetWindowFlags(window: PSDL_Window): UInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowFlags' {$ENDIF} {$ENDIF};
533 * Set the title of a window, in UTF-8 format.
535 * SDL_GetWindowTitle()
538 procedure SDL_SetWindowTitle(window: PSDL_Window; const title: PAnsiChar) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowTitle' {$ENDIF} {$ENDIF};
541 * Get the title of a window, in UTF-8 format.
543 * SDL_SetWindowTitle()
546 function SDL_GetWindowTitle(window: PSDL_Window): PAnsiChar cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowTitle' {$ENDIF} {$ENDIF};
549 * Set the icon for a window.
551 * icon The icon for the window.
554 procedure SDL_SetWindowIcon(window: PSDL_Window; icon: PSDL_Surface) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowIcon' {$ENDIF} {$ENDIF};
557 * Associate an arbitrary named pointer with a window.
559 * window The window to associate with the pointer.
560 * name The name of the pointer.
561 * userdata The associated pointer.
563 * The previous value associated with 'name'
565 * The name is case-sensitive.
567 * SDL_GetWindowData()
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};
573 * Retrieve the data pointer associated with a window.
575 * window The window to query.
576 * name The name of the pointer.
578 * The value associated with 'name'
580 * SDL_SetWindowData()
583 function SDL_GetWindowData(window: PSDL_Window; const name: PAnsiChar): Pointer cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowData' {$ENDIF} {$ENDIF};
586 * Set the position of a window.
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.
594 * The window coordinate origin is the upper left of the display.
596 * SDL_GetWindowPosition()
599 procedure SDL_SetWindowPosition(window: PSDL_Window; x: SInt32; y: SInt32) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowPosition' {$ENDIF} {$ENDIF};
602 * Get the position of a window.
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
607 * SDL_SetWindowPosition()
610 procedure SDL_GetWindowPosition(window: PSDL_Window; x: PInt; y: PInt) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowPosition' {$ENDIF} {$ENDIF};
613 * Set the size of a window's client area.
615 * w The width of the window, must be >0
616 * h The height of the window, must be >0
618 * You can't change the size of a fullscreen window, it automatically
619 * matches the size of the display mode.
621 * SDL_GetWindowSize()
624 procedure SDL_SetWindowSize(window: PSDL_Window; w: SInt32; h: SInt32) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowSize' {$ENDIF} {$ENDIF};
627 * Get the size of a window's client area.
629 * w Pointer to variable for storing the width, may be nil
630 * h Pointer to variable for storing the height, may be nil
632 * SDL_SetWindowSize()
635 procedure SDL_GetWindowSize(window: PSDL_Window; w: PInt; h: PInt) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowSize' {$ENDIF} {$ENDIF};
638 * Set the minimum size of a window's client area.
640 * min_w The minimum width of the window, must be >0
641 * min_h The minimum height of the window, must be >0
643 * You can't change the minimum size of a fullscreen window, it
644 * automatically matches the size of the display mode.
646 * SDL_GetWindowMinimumSize()
647 * SDL_SetWindowMaximumSize()
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};
653 * Get the minimum size of a window's client area.
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
658 * SDL_GetWindowMaximumSize()
659 * SDL_SetWindowMinimumSize()
662 procedure SDL_GetWindowMinimumSize(window: PSDL_Window; w: PInt; h: PInt) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowMinimumSize' {$ENDIF} {$ENDIF};
665 * Set the maximum size of a window's client area.
667 * max_w The maximum width of the window, must be >0
668 * max_h The maximum height of the window, must be >0
670 * You can't change the maximum size of a fullscreen window, it
671 * automatically matches the size of the display mode.
673 * SDL_GetWindowMaximumSize()
674 * SDL_SetWindowMinimumSize()
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};
680 * Get the maximum size of a window's client area.
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
685 * SDL_GetWindowMinimumSize()
686 * SDL_SetWindowMaximumSize()
689 procedure SDL_GetWindowMaximumSize(window: PSDL_Window; w: PInt; h: PInt) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowMaximumSize' {$ENDIF} {$ENDIF};
692 * Set the border state of a window.
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.
698 * window The window of which to change the border state.
699 * bordered SDL_FALSE to remove border, SDL_TRUE to add border.
701 * You can't change the border state of a fullscreen window.
703 * SDL_GetWindowFlags()
706 procedure SDL_SetWindowBordered(window: PSDL_Window; bordered: TSDL_Bool) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowBordered' {$ENDIF} {$ENDIF};
714 procedure SDL_ShowWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_ShowWindow' {$ENDIF} {$ENDIF};
722 procedure SDL_HideWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_HideWindow' {$ENDIF} {$ENDIF};
725 * Raise a window above other windows and set the input focus.
728 procedure SDL_RaiseWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RaiseWindow' {$ENDIF} {$ENDIF};
731 * Make a window as large as possible.
733 * SDL_RestoreWindow()
736 procedure SDL_MaximizeWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_MaximizeWindow' {$ENDIF} {$ENDIF};
739 * Minimize a window to an iconic representation.
741 * SDL_RestoreWindow()
744 procedure SDL_MinimizeWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_MinimizeWindow' {$ENDIF} {$ENDIF};
747 * Restore the size and position of a minimized or maximized window.
749 * SDL_MaximizeWindow()
750 * SDL_MinimizeWindow()
753 procedure SDL_RestoreWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RestoreWindow' {$ENDIF} {$ENDIF};
756 * Set a window's fullscreen state.
758 * 0 on success, or -1 if setting the display mode failed.
760 * SDL_SetWindowDisplayMode()
761 * SDL_GetWindowDisplayMode()
764 function SDL_SetWindowFullscreen(window: PSDL_Window; flags: UInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowFullscreen' {$ENDIF} {$ENDIF};
767 * Get the SDL surface associated with the window.
769 * The window's framebuffer surface, or nil on error.
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.
774 * You may not combine this with 3D or the rendering API on this window.
776 * SDL_UpdateWindowSurface()
777 * SDL_UpdateWindowSurfaceRects()
780 function SDL_GetWindowSurface(window: PSDL_Window): PSDL_Surface cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowSurface' {$ENDIF} {$ENDIF};
783 * Copy the window surface to the screen.
785 * 0 on success, or -1 on error.
787 * SDL_GetWindowSurface()
788 * SDL_UpdateWindowSurfaceRects()
791 function SDL_UpdateWindowSurface(window: PSDL_Window): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_UpdateWindowSurface' {$ENDIF} {$ENDIF};
794 * Copy a number of rectangles on the window surface to the screen.
796 * 0 on success, or -1 on error.
798 * SDL_GetWindowSurface()
799 * SDL_UpdateWindowSurfaceRect()
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};
805 * Set a window's input grab mode.
807 * grabbed This is SDL_TRUE to grab input, and SDL_FALSE to release input.
809 * SDL_GetWindowGrab()
812 procedure SDL_SetWindowGrab(window: PSDL_Window; grabbed: TSDL_Bool) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowGrab' {$ENDIF} {$ENDIF};
815 * Get a window's input grab mode.
817 * This returns SDL_TRUE if input is grabbed, and SDL_FALSE otherwise.
819 * SDL_SetWindowGrab()
822 function SDL_GetWindowGrab(window: PSDL_Window): TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowGrab' {$ENDIF} {$ENDIF};
825 * Set the brightness (gamma correction) for a window.
827 * 0 on success, or -1 if setting the brightness isn't supported.
829 * SDL_GetWindowBrightness()
830 * SDL_SetWindowGammaRamp()
833 function SDL_SetWindowBrightness(window: PSDL_Window; brightness: Float): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowBrightness' {$ENDIF} {$ENDIF};
836 * Get the brightness (gamma correction) for a window.
838 * The last brightness value passed to SDL_SetWindowBrightness()
840 * SDL_SetWindowBrightness()
843 function SDL_GetWindowBrightness(window: PSDL_Window): Float cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowBrightness' {$ENDIF} {$ENDIF};
846 * Set the gamma ramp for a window.
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.
852 * 0 on success, or -1 if gamma ramps are unsupported.
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.
860 * SDL_GetWindowGammaRamp()
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};
866 * Get the gamma ramp for a window.
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.
875 * 0 on success, or -1 if gamma ramps are unsupported.
877 * SDL_SetWindowGammaRamp()
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};
886 procedure SDL_DestroyWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_DestroyWindow' {$ENDIF} {$ENDIF};
889 * Returns whether the screensaver is currently enabled (default on).
891 * SDL_EnableScreenSaver()
892 * SDL_DisableScreenSaver()
895 function SDL_IsScreenSaverEnabled: TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_IsScreenSaverEnabled' {$ENDIF} {$ENDIF};
898 * Allow the screen to be blanked by a screensaver
900 * SDL_IsScreenSaverEnabled()
901 * SDL_DisableScreenSaver()
904 procedure SDL_EnableScreenSaver cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_EnableScreenSaver' {$ENDIF} {$ENDIF};
907 * Prevent the screen from being blanked by a screensaver
909 * SDL_IsScreenSaverEnabled()
910 * SDL_EnableScreenSaver()
913 procedure SDL_DisableScreenSaver cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_DisableScreenSaver' {$ENDIF} {$ENDIF};
916 * OpenGL support functions
920 * Dynamically load an OpenGL library.
922 * path The platform dependent OpenGL library name, or nil to open the
923 * default OpenGL library.
925 * 0 on success, or -1 if the library couldn't be loaded.
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.
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().
934 * SDL_GL_GetProcAddress()
935 * SDL_GL_UnloadLibrary()
938 function SDL_GL_LoadLibrary(const path: PAnsiChar): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_LoadLibrary' {$ENDIF} {$ENDIF};
941 * Get the address of an OpenGL function.
944 function SDL_GL_GetProcAddress(const proc: PAnsiChar): Pointer cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetProcAddress' {$ENDIF} {$ENDIF};
947 * Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary().
949 * SDL_GL_LoadLibrary()
952 procedure SDL_GL_UnloadLibrary cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_UnloadLibrary' {$ENDIF} {$ENDIF};
955 * Return true if an OpenGL extension is supported for the current
959 function SDL_GL_ExtensionSupported(const extension: PAnsiChar): TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_ExtensionSupported' {$ENDIF} {$ENDIF};
962 * Set an OpenGL window attribute before window creation.
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};
968 * Get the actual value for an attribute from the current context.
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};
974 * Create an OpenGL context for use with an OpenGL window, and make it
977 * SDL_GL_DeleteContext()
980 function SDL_GL_CreateContext(window: PSDL_Window): TSDL_GLContext cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_CreateContext' {$ENDIF} {$ENDIF};
983 * Set up an OpenGL context for rendering into an OpenGL window.
985 * The context must have been created with a compatible window.
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};
991 * Get the currently active OpenGL window.
993 function SDL_GL_GetCurrentWindow: PSDL_Window cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetCurrentWindow' {$ENDIF} {$ENDIF};
996 * Get the currently active OpenGL context.
998 function SDL_GL_GetCurrentContext: TSDL_GLContext cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetCurrentContext' {$ENDIF} {$ENDIF};
1001 * Set the swap interval for the current OpenGL context.
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.
1008 * 0 on success, or -1 if setting the swap interval is not supported.
1010 * SDL_GL_GetSwapInterval()
1013 function SDL_GL_SetSwapInterval(interval: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_SetSwapInterval' {$ENDIF} {$ENDIF};
1016 * Get the swap interval for the current OpenGL context.
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.
1024 * SDL_GL_SetSwapInterval()
1027 function SDL_GL_GetSwapInterval: SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetSwapInterval' {$ENDIF} {$ENDIF};
1030 * Swap the OpenGL buffers for a window, if double-buffering is
1034 procedure SDL_GL_SwapWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_SwapWindow' {$ENDIF} {$ENDIF};
1037 * Delete an OpenGL context.
1039 * SDL_GL_CreateContext()
1042 procedure SDL_GL_DeleteContext(context: TSDL_GLContext) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_DeleteContext' {$ENDIF} {$ENDIF};
1044 {*OpenGL support functions*}