DEADSOFTWARE

Added touchscreen controls
[d2df-sdl.git] / src / lib / sdl2 / sdlvideo.inc
1 //from "sdl_video.h"
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 *}
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;
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;
30 {* The user's specified coordinates for the window, for once we give it a shape. *}
31 userx,usery: UInt32;
33 {* The parameters for shape calculation. *}
34 mode: TSDL_WindowShapeMode;
36 {* Has this window been assigned a shape? *}
37 hasshape: TSDL_Bool;
39 driverdata: Pointer;
40 end;
42 PSDL_WindowUserData = ^TSDL_WindowUserData;
43 TSDL_WindowUserData = record
44 name: PAnsiChar;
45 data: Pointer;
46 next: PSDL_WindowUserData;
47 end;
49 {* Define the SDL window structure, corresponding to toplevel windows *}
50 TSDL_Window = record
51 magic: Pointer;
52 id: UInt32;
53 title: PAnsiChar;
54 icon: PSDL_Surface;
55 x,y: SInt32;
56 w,h: SInt32;
57 min_w, min_h: SInt32;
58 max_w, max_h: SInt32;
59 flags: UInt32;
61 {* Stored position and size for windowed mode * }
62 windowed: TSDL_Rect;
64 fullscreen_mode: TSDL_DisplayMode;
66 brightness: Float;
67 gamma: PUInt16;
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;
77 driverdata: Pointer;
79 prev: PSDL_Window;
80 next: PSDL_Window;
81 end;
83 {**
84 * Get the shape parameters of a shaped window.
85 *
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.
88 *
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.
92 *
93 * SDL_WindowShapeMode
94 * SDL_SetWindowShape
95 *}
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};
98 {**
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.
110 *}
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};
113 {**
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()
132 *}
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};
135 {**
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
142 *}
143 function SDL_IsShapedWindow(window: PSDL_Window): TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_IsShapedWindow' {$ENDIF} {$ENDIF};
145 {**
146 * The type used to identify a window
148 * SDL_CreateWindow()
149 * SDL_CreateWindowFrom()
150 * SDL_DestroyWindow()
151 * SDL_GetWindowData()
152 * SDL_GetWindowFlags()
153 * SDL_GetWindowGrab()
154 * SDL_GetWindowPosition()
155 * SDL_GetWindowSize()
156 * SDL_GetWindowTitle()
157 * SDL_HideWindow()
158 * SDL_MaximizeWindow()
159 * SDL_MinimizeWindow()
160 * SDL_RaiseWindow()
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()
170 * SDL_ShowWindow()
171 *}
173 const
174 {**
175 * The flags on a window
177 * SDL_GetWindowFlags()
178 *}
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 *}
195 type
196 TSDL_WindowFlags = DWord;
198 function SDL_WindowPos_IsUndefined(X: Variant): Variant;
199 function SDL_WindowPos_IsCentered(X: Variant): Variant;
201 const
202 {**
203 * Used to indicate that you don't care what the window position is.
204 *}
206 SDL_WINDOWPOS_UNDEFINED_MASK = $1FFF0000;
207 SDL_WINDOWPOS_UNDEFINED = SDL_WINDOWPOS_UNDEFINED_MASK or 0;
210 {**
211 * Used to indicate that the window position should be centered.
212 *}
214 SDL_WINDOWPOS_CENTERED_MASK = $2FFF0000;
215 SDL_WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED_MASK or 0;
217 {**
218 * Event subtype for window events
219 *}
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 *}
237 type
238 TSDL_WindowEventID = DWord;
240 {**
241 * An opaque handle to an OpenGL context.
242 *}
244 TSDL_GLContext = Pointer;
246 {**
247 * OpenGL configuration attributes
248 *}
250 const
251 SDL_GL_RED_SIZE = 0;
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;
263 SDL_GL_STEREO = 12;
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;
276 type
277 TSDL_GLattr = DWord;
279 const
280 SDL_GL_CONTEXT_PROFILE_CORE = $0001;
281 SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = $0002;
282 SDL_GL_CONTEXT_PROFILE_ES = $0004;
284 type
285 TSDL_GLprofile = DWord;
287 const
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;
293 type
294 TSDL_GLcontextFlag = DWord;
296 {* Function prototypes *}
298 {**
299 * Get the number of video drivers compiled into SDL
301 * SDL_GetVideoDriver()
302 *}
304 function SDL_GetNumVideoDrivers: SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetNumVideoDrivers' {$ENDIF} {$ENDIF};
306 {**
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()
313 *}
315 function SDL_GetVideoDriver(index: SInt32): PAnsiChar cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetVideoDriver' {$ENDIF} {$ENDIF};
317 {**
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.
329 * SDL_VideoQuit()
330 *}
332 function SDL_VideoInit(const driver_name: PAnsiChar): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_VideoInit' {$ENDIF} {$ENDIF};
334 {**
335 * Shuts down the video subsystem.
337 * function closes all windows, and restores the original video mode.
339 * SDL_VideoInit()
340 *}
341 procedure SDL_VideoQuit cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_VideoQuit' {$ENDIF} {$ENDIF};
343 {**
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()
351 *}
353 function SDL_GetCurrentVideoDriver: PAnsiChar cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetCurrentVideoDriver' {$ENDIF} {$ENDIF};
355 {**
356 * Returns the number of available video displays.
358 * SDL_GetDisplayBounds()
359 *}
361 function SDL_GetNumVideoDisplays: SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetNumVideoDisplays' {$ENDIF} {$ENDIF};
363 {**
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()
369 *}
371 function SDL_GetDisplayName(displayIndex: SInt32): PAnsiChar cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetDisplayName' {$ENDIF} {$ENDIF};
373 {**
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()
380 *}
382 function SDL_GetDisplayBounds(displayIndex: SInt32; rect: PSDL_Rect): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetDisplayBounds' {$ENDIF} {$ENDIF};
384 {**
385 * Returns the number of available display modes.
387 * SDL_GetDisplayMode()
388 *}
390 function SDL_GetNumDisplayModes(displayIndex: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetNumDisplayModes' {$ENDIF} {$ENDIF};
392 {**
393 * Get the dots/pixels-per-inch for a display.
394 *}
396 function SDL_GetDisplayDPI(displayIndex: SInt32; ddpi, hdpi, vdpi: PFloat): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetDisplayDPI' {$ENDIF} {$ENDIF};
398 {**
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()
408 *}
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};
412 {**
413 * Fill in information about the desktop display mode.
414 *}
416 function SDL_GetDesktopDisplayMode(displayIndex: SInt32; mode: PSDL_DisplayMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetDesktopDisplayMode' {$ENDIF} {$ENDIF};
418 {**
419 * Fill in information about the current display mode.
420 *}
422 function SDL_GetCurrentDisplayMode(displayIndex: SInt32; mode: PSDL_DisplayMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetCurrentDisplayIndex' {$ENDIF} {$ENDIF};
424 {**
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
432 * was available.
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()
443 *}
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};
447 {**
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.
452 *}
454 function SDL_GetWindowDisplayIndex(window: PSDL_Window): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowDisplayIndex' {$ENDIF} {$ENDIF};
456 {**
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
460 * are used.
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()
468 *}
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};
472 {**
473 * Fill in information about the display mode used when a fullscreen
474 * window is visible.
476 * SDL_SetWindowDisplayMode()
477 * SDL_SetWindowFullscreen()
478 *}
480 function SDL_GetWindowDisplayMode(window: PSDL_Window; mode: PSDL_DisplayMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowDisplayMode' {$ENDIF} {$ENDIF};
482 {**
483 * Get the pixel format associated with the window.
484 *}
486 function SDL_GetWindowPixelFormat(window: PSDL_Window): UInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowPixelFormat' {$ENDIF} {$ENDIF};
488 {**
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()
507 *}
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};
511 {**
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()
519 *}
521 function SDL_CreateWindowFrom(const data: Pointer): PSDL_Window cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_CreateWindowFrom' {$ENDIF} {$ENDIF};
523 {**
524 * Get the numeric ID of a window, for logging purposes.
525 *}
527 function SDL_GetWindowID(window: PSDL_Window): UInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowID' {$ENDIF} {$ENDIF};
529 {**
530 * Get a window from a stored ID, or nil if it doesn't exist.
531 *}
533 function SDL_GetWindowFromID(id: UInt32): PSDL_Window cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowFromID' {$ENDIF} {$ENDIF};
535 {**
536 * Get the window flags.
537 *}
539 function SDL_GetWindowFlags(window: PSDL_Window): UInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowFlags' {$ENDIF} {$ENDIF};
541 {**
542 * Set the title of a window, in UTF-8 format.
544 * SDL_GetWindowTitle()
545 *}
547 procedure SDL_SetWindowTitle(window: PSDL_Window; const title: PAnsiChar) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowTitle' {$ENDIF} {$ENDIF};
549 {**
550 * Get the title of a window, in UTF-8 format.
552 * SDL_SetWindowTitle()
553 *}
555 function SDL_GetWindowTitle(window: PSDL_Window): PAnsiChar cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowTitle' {$ENDIF} {$ENDIF};
557 {**
558 * Set the icon for a window.
560 * icon The icon for the window.
561 *}
563 procedure SDL_SetWindowIcon(window: PSDL_Window; icon: PSDL_Surface) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowIcon' {$ENDIF} {$ENDIF};
565 {**
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()
577 *}
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};
581 {**
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()
590 *}
592 function SDL_GetWindowData(window: PSDL_Window; const name: PAnsiChar): Pointer cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowData' {$ENDIF} {$ENDIF};
594 {**
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()
606 *}
608 procedure SDL_SetWindowPosition(window: PSDL_Window; x: SInt32; y: SInt32) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowPosition' {$ENDIF} {$ENDIF};
610 {**
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()
617 *}
619 procedure SDL_GetWindowPosition(window: PSDL_Window; x: PInt; y: PInt) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowPosition' {$ENDIF} {$ENDIF};
621 {**
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()
631 *}
633 procedure SDL_SetWindowSize(window: PSDL_Window; w: SInt32; h: SInt32) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowSize' {$ENDIF} {$ENDIF};
635 {**
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()
642 *}
644 procedure SDL_GetWindowSize(window: PSDL_Window; w: PInt; h: PInt) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowSize' {$ENDIF} {$ENDIF};
646 {**
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()
657 *}
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};
661 {**
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()
669 *}
671 procedure SDL_GetWindowMinimumSize(window: PSDL_Window; w: PInt; h: PInt) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowMinimumSize' {$ENDIF} {$ENDIF};
673 {**
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()
684 *}
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};
688 {**
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()
696 *}
698 procedure SDL_GetWindowMaximumSize(window: PSDL_Window; w: PInt; h: PInt) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowMaximumSize' {$ENDIF} {$ENDIF};
700 {**
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()
713 *}
715 procedure SDL_SetWindowBordered(window: PSDL_Window; bordered: TSDL_Bool) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowBordered' {$ENDIF} {$ENDIF};
717 {**
718 * Show a window.
720 * SDL_HideWindow()
721 *}
723 procedure SDL_ShowWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_ShowWindow' {$ENDIF} {$ENDIF};
725 {**
726 * Hide a window.
728 * SDL_ShowWindow()
729 *}
731 procedure SDL_HideWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_HideWindow' {$ENDIF} {$ENDIF};
733 {**
734 * Raise a window above other windows and set the input focus.
735 *}
737 procedure SDL_RaiseWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RaiseWindow' {$ENDIF} {$ENDIF};
739 {**
740 * Make a window as large as possible.
742 * SDL_RestoreWindow()
743 *}
745 procedure SDL_MaximizeWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_MaximizeWindow' {$ENDIF} {$ENDIF};
747 {**
748 * Minimize a window to an iconic representation.
750 * SDL_RestoreWindow()
751 *}
753 procedure SDL_MinimizeWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_MinimizeWindow' {$ENDIF} {$ENDIF};
755 {**
756 * Restore the size and position of a minimized or maximized window.
758 * SDL_MaximizeWindow()
759 * SDL_MinimizeWindow()
760 *}
762 procedure SDL_RestoreWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RestoreWindow' {$ENDIF} {$ENDIF};
764 {**
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()
771 *}
773 function SDL_SetWindowFullscreen(window: PSDL_Window; flags: UInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowFullscreen' {$ENDIF} {$ENDIF};
775 {**
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()
787 *}
789 function SDL_GetWindowSurface(window: PSDL_Window): PSDL_Surface cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowSurface' {$ENDIF} {$ENDIF};
791 {**
792 * Copy the window surface to the screen.
794 * 0 on success, or -1 on error.
796 * SDL_GetWindowSurface()
797 * SDL_UpdateWindowSurfaceRects()
798 *}
800 function SDL_UpdateWindowSurface(window: PSDL_Window): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_UpdateWindowSurface' {$ENDIF} {$ENDIF};
802 {**
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()
809 *}
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};
813 {**
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()
819 *}
821 procedure SDL_SetWindowGrab(window: PSDL_Window; grabbed: TSDL_Bool) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowGrab' {$ENDIF} {$ENDIF};
823 {**
824 * Get a window's input grab mode.
826 * This returns SDL_TRUE if input is grabbed, and SDL_FALSE otherwise.
828 * SDL_SetWindowGrab()
829 *}
831 function SDL_GetWindowGrab(window: PSDL_Window): TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowGrab' {$ENDIF} {$ENDIF};
833 {**
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()
840 *}
842 function SDL_SetWindowBrightness(window: PSDL_Window; brightness: Float): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowBrightness' {$ENDIF} {$ENDIF};
844 {**
845 * Get the brightness (gamma correction) for a window.
847 * The last brightness value passed to SDL_SetWindowBrightness()
849 * SDL_SetWindowBrightness()
850 *}
852 function SDL_GetWindowBrightness(window: PSDL_Window): Float cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowBrightness' {$ENDIF} {$ENDIF};
854 {**
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()
870 *}
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};
874 {**
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()
887 *}
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};
891 {**
892 * Destroy a window.
893 *}
895 procedure SDL_DestroyWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_DestroyWindow' {$ENDIF} {$ENDIF};
897 {**
898 * Returns whether the screensaver is currently enabled (default on).
900 * SDL_EnableScreenSaver()
901 * SDL_DisableScreenSaver()
902 *}
904 function SDL_IsScreenSaverEnabled: TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_IsScreenSaverEnabled' {$ENDIF} {$ENDIF};
906 {**
907 * Allow the screen to be blanked by a screensaver
909 * SDL_IsScreenSaverEnabled()
910 * SDL_DisableScreenSaver()
911 *}
913 procedure SDL_EnableScreenSaver cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_EnableScreenSaver' {$ENDIF} {$ENDIF};
915 {**
916 * Prevent the screen from being blanked by a screensaver
918 * SDL_IsScreenSaverEnabled()
919 * SDL_EnableScreenSaver()
920 *}
922 procedure SDL_DisableScreenSaver cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_DisableScreenSaver' {$ENDIF} {$ENDIF};
924 {**
925 * OpenGL support functions
926 *}
928 {**
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()
945 *}
947 function SDL_GL_LoadLibrary(const path: PAnsiChar): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_LoadLibrary' {$ENDIF} {$ENDIF};
949 {**
950 * Get the address of an OpenGL function.
951 *}
953 function SDL_GL_GetProcAddress(const proc: PAnsiChar): Pointer cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetProcAddress' {$ENDIF} {$ENDIF};
955 {**
956 * Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary().
958 * SDL_GL_LoadLibrary()
959 *}
961 procedure SDL_GL_UnloadLibrary cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_UnloadLibrary' {$ENDIF} {$ENDIF};
963 {**
964 * Return true if an OpenGL extension is supported for the current
965 * context.
966 *}
968 function SDL_GL_ExtensionSupported(const extension: PAnsiChar): TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_ExtensionSupported' {$ENDIF} {$ENDIF};
970 {**
971 * Reset all previously set OpenGL context attributes to their default values
972 *}
973 procedure SDL_GL_ResetAttributes(); cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_ResetAttributes' {$ENDIF} {$ENDIF};
975 {**
976 * Set an OpenGL window attribute before window creation.
977 *}
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};
981 {**
982 * Get the actual value for an attribute from the current context.
983 *}
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};
987 {**
988 * Create an OpenGL context for use with an OpenGL window, and make it
989 * current.
991 * SDL_GL_DeleteContext()
992 *}
994 function SDL_GL_CreateContext(window: PSDL_Window): TSDL_GLContext cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_CreateContext' {$ENDIF} {$ENDIF};
996 {**
997 * Set up an OpenGL context for rendering into an OpenGL window.
999 * The context must have been created with a compatible window.
1000 *}
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};
1004 {**
1005 * Get the currently active OpenGL window.
1006 *}
1007 function SDL_GL_GetCurrentWindow: PSDL_Window cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetCurrentWindow' {$ENDIF} {$ENDIF};
1009 {**
1010 * Get the currently active OpenGL context.
1011 *}
1012 function SDL_GL_GetCurrentContext: TSDL_GLContext cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetCurrentContext' {$ENDIF} {$ENDIF};
1014 {**
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()
1025 *}
1027 function SDL_GL_SetSwapInterval(interval: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_SetSwapInterval' {$ENDIF} {$ENDIF};
1029 {**
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()
1039 *}
1041 function SDL_GL_GetSwapInterval: SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetSwapInterval' {$ENDIF} {$ENDIF};
1043 {**
1044 * Swap the OpenGL buffers for a window, if double-buffering is
1045 * supported.
1046 *}
1048 procedure SDL_GL_SwapWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_SwapWindow' {$ENDIF} {$ENDIF};
1050 {**
1051 * Delete an OpenGL context.
1053 * SDL_GL_CreateContext()
1054 *}
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*}