DEADSOFTWARE

show map loading update once per 300 msec; it nearly halves loading times for huge...
[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 * Fill in information about a specific display mode.
395 * The display modes are sorted in this priority:
396 * bits per pixel -> more colors to fewer colors
397 * width -> largest to smallest
398 * height -> largest to smallest
399 * refresh rate -> highest to lowest
401 * SDL_GetNumDisplayModes()
402 *}
404 function SDL_GetDisplayMode(displayIndex: SInt32; modeIndex: SInt32; mode: PSDL_DisplayMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetDisplayMode' {$ENDIF} {$ENDIF};
406 {**
407 * Fill in information about the desktop display mode.
408 *}
410 function SDL_GetDesktopDisplayMode(displayIndex: SInt32; mode: PSDL_DisplayMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetDesktopDisplayMode' {$ENDIF} {$ENDIF};
412 {**
413 * Fill in information about the current display mode.
414 *}
416 function SDL_GetCurrentDisplayMode(displayIndex: SInt32; mode: PSDL_DisplayMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetCurrentDisplayIndex' {$ENDIF} {$ENDIF};
418 {**
419 * Get the closest match to the requested display mode.
421 * mode The desired display mode
422 * closest A pointer to a display mode to be filled in with the closest
423 * match of the available display modes.
425 * The passed in value closest, or nil if no matching video mode
426 * was available.
428 * The available display modes are scanned, and closest is filled in with the
429 * closest mode matching the requested mode and returned. The mode format and
430 * refresh_rate default to the desktop mode if they are 0. The modes are
431 * scanned with size being first priority, format being second priority, and
432 * finally checking the refresh_rate. If all the available modes are too
433 * small, then nil is returned.
435 * SDL_GetNumDisplayModes()
436 * SDL_GetDisplayMode()
437 *}
439 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};
441 {**
442 * Get the display index associated with a window.
444 * the display index of the display containing the center of the
445 * window, or -1 on error.
446 *}
448 function SDL_GetWindowDisplayIndex(window: PSDL_Window): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowDisplayIndex' {$ENDIF} {$ENDIF};
450 {**
451 * Set the display mode used when a fullscreen window is visible.
453 * By default the window's dimensions and the desktop format and refresh rate
454 * are used.
456 * mode The mode to use, or nil for the default mode.
458 * 0 on success, or -1 if setting the display mode failed.
460 * SDL_GetWindowDisplayMode()
461 * SDL_SetWindowFullscreen()
462 *}
464 function SDL_SetWindowDisplayMode(window: PSDL_Window; const mode: PSDL_DisplayMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowDisplayMode' {$ENDIF} {$ENDIF};
466 {**
467 * Fill in information about the display mode used when a fullscreen
468 * window is visible.
470 * SDL_SetWindowDisplayMode()
471 * SDL_SetWindowFullscreen()
472 *}
474 function SDL_GetWindowDisplayMode(window: PSDL_Window; mode: PSDL_DisplayMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowDisplayMode' {$ENDIF} {$ENDIF};
476 {**
477 * Get the pixel format associated with the window.
478 *}
480 function SDL_GetWindowPixelFormat(window: PSDL_Window): UInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowPixelFormat' {$ENDIF} {$ENDIF};
482 {**
483 * Create a window with the specified position, dimensions, and flags.
485 * title The title of the window, in UTF-8 encoding.
486 * x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
487 * ::SDL_WINDOWPOS_UNDEFINED.
488 * y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
489 * ::SDL_WINDOWPOS_UNDEFINED.
490 * w The width of the window.
491 * h The height of the window.
492 * flags The flags for the window, a mask of any of the following:
493 * ::SDL_WINDOW_FULLSCREEN, ::SDL_WINDOW_OPENGL,
494 * ::SDL_WINDOW_SHOWN, ::SDL_WINDOW_BORDERLESS,
495 * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED,
496 * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_INPUT_GRABBED.
498 * The id of the window created, or zero if window creation failed.
500 * SDL_DestroyWindow()
501 *}
503 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};
505 {**
506 * Create an SDL window from an existing native window.
508 * data A pointer to driver-dependent window creation data
510 * The id of the window created, or zero if window creation failed.
512 * SDL_DestroyWindow()
513 *}
515 function SDL_CreateWindowFrom(const data: Pointer): PSDL_Window cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_CreateWindowFrom' {$ENDIF} {$ENDIF};
517 {**
518 * Get the numeric ID of a window, for logging purposes.
519 *}
521 function SDL_GetWindowID(window: PSDL_Window): UInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowID' {$ENDIF} {$ENDIF};
523 {**
524 * Get a window from a stored ID, or nil if it doesn't exist.
525 *}
527 function SDL_GetWindowFromID(id: UInt32): PSDL_Window cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowFromID' {$ENDIF} {$ENDIF};
529 {**
530 * Get the window flags.
531 *}
533 function SDL_GetWindowFlags(window: PSDL_Window): UInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowFlags' {$ENDIF} {$ENDIF};
535 {**
536 * Set the title of a window, in UTF-8 format.
538 * SDL_GetWindowTitle()
539 *}
541 procedure SDL_SetWindowTitle(window: PSDL_Window; const title: PAnsiChar) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowTitle' {$ENDIF} {$ENDIF};
543 {**
544 * Get the title of a window, in UTF-8 format.
546 * SDL_SetWindowTitle()
547 *}
549 function SDL_GetWindowTitle(window: PSDL_Window): PAnsiChar cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowTitle' {$ENDIF} {$ENDIF};
551 {**
552 * Set the icon for a window.
554 * icon The icon for the window.
555 *}
557 procedure SDL_SetWindowIcon(window: PSDL_Window; icon: PSDL_Surface) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowIcon' {$ENDIF} {$ENDIF};
559 {**
560 * Associate an arbitrary named pointer with a window.
562 * window The window to associate with the pointer.
563 * name The name of the pointer.
564 * userdata The associated pointer.
566 * The previous value associated with 'name'
568 * The name is case-sensitive.
570 * SDL_GetWindowData()
571 *}
573 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};
575 {**
576 * Retrieve the data pointer associated with a window.
578 * window The window to query.
579 * name The name of the pointer.
581 * The value associated with 'name'
583 * SDL_SetWindowData()
584 *}
586 function SDL_GetWindowData(window: PSDL_Window; const name: PAnsiChar): Pointer cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowData' {$ENDIF} {$ENDIF};
588 {**
589 * Set the position of a window.
591 * window The window to reposition.
592 * x The x coordinate of the window, SDL_WINDOWPOS_CENTERED, or
593 * SDL_WINDOWPOS_UNDEFINED.
594 * y The y coordinate of the window, SDL_WINDOWPOS_CENTERED, or
595 * SDL_WINDOWPOS_UNDEFINED.
597 * The window coordinate origin is the upper left of the display.
599 * SDL_GetWindowPosition()
600 *}
602 procedure SDL_SetWindowPosition(window: PSDL_Window; x: SInt32; y: SInt32) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowPosition' {$ENDIF} {$ENDIF};
604 {**
605 * Get the position of a window.
607 * x Pointer to variable for storing the x position, may be nil
608 * y Pointer to variable for storing the y position, may be nil
610 * SDL_SetWindowPosition()
611 *}
613 procedure SDL_GetWindowPosition(window: PSDL_Window; x: PInt; y: PInt) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowPosition' {$ENDIF} {$ENDIF};
615 {**
616 * Set the size of a window's client area.
618 * w The width of the window, must be >0
619 * h The height of the window, must be >0
621 * You can't change the size of a fullscreen window, it automatically
622 * matches the size of the display mode.
624 * SDL_GetWindowSize()
625 *}
627 procedure SDL_SetWindowSize(window: PSDL_Window; w: SInt32; h: SInt32) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowSize' {$ENDIF} {$ENDIF};
629 {**
630 * Get the size of a window's client area.
632 * w Pointer to variable for storing the width, may be nil
633 * h Pointer to variable for storing the height, may be nil
635 * SDL_SetWindowSize()
636 *}
638 procedure SDL_GetWindowSize(window: PSDL_Window; w: PInt; h: PInt) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowSize' {$ENDIF} {$ENDIF};
640 {**
641 * Set the minimum size of a window's client area.
643 * min_w The minimum width of the window, must be >0
644 * min_h The minimum height of the window, must be >0
646 * You can't change the minimum size of a fullscreen window, it
647 * automatically matches the size of the display mode.
649 * SDL_GetWindowMinimumSize()
650 * SDL_SetWindowMaximumSize()
651 *}
653 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};
655 {**
656 * Get the minimum size of a window's client area.
658 * w Pointer to variable for storing the minimum width, may be nil
659 * h Pointer to variable for storing the minimum height, may be nil
661 * SDL_GetWindowMaximumSize()
662 * SDL_SetWindowMinimumSize()
663 *}
665 procedure SDL_GetWindowMinimumSize(window: PSDL_Window; w: PInt; h: PInt) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowMinimumSize' {$ENDIF} {$ENDIF};
667 {**
668 * Set the maximum size of a window's client area.
670 * max_w The maximum width of the window, must be >0
671 * max_h The maximum height of the window, must be >0
673 * You can't change the maximum size of a fullscreen window, it
674 * automatically matches the size of the display mode.
676 * SDL_GetWindowMaximumSize()
677 * SDL_SetWindowMinimumSize()
678 *}
680 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};
682 {**
683 * Get the maximum size of a window's client area.
685 * w Pointer to variable for storing the maximum width, may be nil
686 * h Pointer to variable for storing the maximum height, may be nil
688 * SDL_GetWindowMinimumSize()
689 * SDL_SetWindowMaximumSize()
690 *}
692 procedure SDL_GetWindowMaximumSize(window: PSDL_Window; w: PInt; h: PInt) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowMaximumSize' {$ENDIF} {$ENDIF};
694 {**
695 * Set the border state of a window.
697 * This will add or remove the window's SDL_WINDOW_BORDERLESS flag and
698 * add or remove the border from the actual window. This is a no-op if the
699 * window's border already matches the requested state.
701 * window The window of which to change the border state.
702 * bordered SDL_FALSE to remove border, SDL_TRUE to add border.
704 * You can't change the border state of a fullscreen window.
706 * SDL_GetWindowFlags()
707 *}
709 procedure SDL_SetWindowBordered(window: PSDL_Window; bordered: TSDL_Bool) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowBordered' {$ENDIF} {$ENDIF};
711 {**
712 * Show a window.
714 * SDL_HideWindow()
715 *}
717 procedure SDL_ShowWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_ShowWindow' {$ENDIF} {$ENDIF};
719 {**
720 * Hide a window.
722 * SDL_ShowWindow()
723 *}
725 procedure SDL_HideWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_HideWindow' {$ENDIF} {$ENDIF};
727 {**
728 * Raise a window above other windows and set the input focus.
729 *}
731 procedure SDL_RaiseWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RaiseWindow' {$ENDIF} {$ENDIF};
733 {**
734 * Make a window as large as possible.
736 * SDL_RestoreWindow()
737 *}
739 procedure SDL_MaximizeWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_MaximizeWindow' {$ENDIF} {$ENDIF};
741 {**
742 * Minimize a window to an iconic representation.
744 * SDL_RestoreWindow()
745 *}
747 procedure SDL_MinimizeWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_MinimizeWindow' {$ENDIF} {$ENDIF};
749 {**
750 * Restore the size and position of a minimized or maximized window.
752 * SDL_MaximizeWindow()
753 * SDL_MinimizeWindow()
754 *}
756 procedure SDL_RestoreWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RestoreWindow' {$ENDIF} {$ENDIF};
758 {**
759 * Set a window's fullscreen state.
761 * 0 on success, or -1 if setting the display mode failed.
763 * SDL_SetWindowDisplayMode()
764 * SDL_GetWindowDisplayMode()
765 *}
767 function SDL_SetWindowFullscreen(window: PSDL_Window; flags: UInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowFullscreen' {$ENDIF} {$ENDIF};
769 {**
770 * Get the SDL surface associated with the window.
772 * The window's framebuffer surface, or nil on error.
774 * A new surface will be created with the optimal format for the window,
775 * if necessary. This surface will be freed when the window is destroyed.
777 * You may not combine this with 3D or the rendering API on this window.
779 * SDL_UpdateWindowSurface()
780 * SDL_UpdateWindowSurfaceRects()
781 *}
783 function SDL_GetWindowSurface(window: PSDL_Window): PSDL_Surface cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowSurface' {$ENDIF} {$ENDIF};
785 {**
786 * Copy the window surface to the screen.
788 * 0 on success, or -1 on error.
790 * SDL_GetWindowSurface()
791 * SDL_UpdateWindowSurfaceRects()
792 *}
794 function SDL_UpdateWindowSurface(window: PSDL_Window): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_UpdateWindowSurface' {$ENDIF} {$ENDIF};
796 {**
797 * Copy a number of rectangles on the window surface to the screen.
799 * 0 on success, or -1 on error.
801 * SDL_GetWindowSurface()
802 * SDL_UpdateWindowSurfaceRect()
803 *}
805 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};
807 {**
808 * Set a window's input grab mode.
810 * grabbed This is SDL_TRUE to grab input, and SDL_FALSE to release input.
812 * SDL_GetWindowGrab()
813 *}
815 procedure SDL_SetWindowGrab(window: PSDL_Window; grabbed: TSDL_Bool) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowGrab' {$ENDIF} {$ENDIF};
817 {**
818 * Get a window's input grab mode.
820 * This returns SDL_TRUE if input is grabbed, and SDL_FALSE otherwise.
822 * SDL_SetWindowGrab()
823 *}
825 function SDL_GetWindowGrab(window: PSDL_Window): TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowGrab' {$ENDIF} {$ENDIF};
827 {**
828 * Set the brightness (gamma correction) for a window.
830 * 0 on success, or -1 if setting the brightness isn't supported.
832 * SDL_GetWindowBrightness()
833 * SDL_SetWindowGammaRamp()
834 *}
836 function SDL_SetWindowBrightness(window: PSDL_Window; brightness: Float): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetWindowBrightness' {$ENDIF} {$ENDIF};
838 {**
839 * Get the brightness (gamma correction) for a window.
841 * The last brightness value passed to SDL_SetWindowBrightness()
843 * SDL_SetWindowBrightness()
844 *}
846 function SDL_GetWindowBrightness(window: PSDL_Window): Float cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetWindowBrightness' {$ENDIF} {$ENDIF};
848 {**
849 * Set the gamma ramp for a window.
851 * red The translation table for the red channel, or nil.
852 * green The translation table for the green channel, or nil.
853 * blue The translation table for the blue channel, or nil.
855 * 0 on success, or -1 if gamma ramps are unsupported.
857 * Set the gamma translation table for the red, green, and blue channels
858 * of the video hardware. Each table is an array of 256 16-bit quantities,
859 * representing a mapping between the input and output for that channel.
860 * The input is the index into the array, and the output is the 16-bit
861 * gamma value at that index, scaled to the output color precision.
863 * SDL_GetWindowGammaRamp()
864 *}
866 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};
868 {**
869 * Get the gamma ramp for a window.
871 * red A pointer to a 256 element array of 16-bit quantities to hold
872 * the translation table for the red channel, or nil.
873 * green A pointer to a 256 element array of 16-bit quantities to hold
874 * the translation table for the green channel, or nil.
875 * blue A pointer to a 256 element array of 16-bit quantities to hold
876 * the translation table for the blue channel, or nil.
878 * 0 on success, or -1 if gamma ramps are unsupported.
880 * SDL_SetWindowGammaRamp()
881 *}
883 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};
885 {**
886 * Destroy a window.
887 *}
889 procedure SDL_DestroyWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_DestroyWindow' {$ENDIF} {$ENDIF};
891 {**
892 * Returns whether the screensaver is currently enabled (default on).
894 * SDL_EnableScreenSaver()
895 * SDL_DisableScreenSaver()
896 *}
898 function SDL_IsScreenSaverEnabled: TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_IsScreenSaverEnabled' {$ENDIF} {$ENDIF};
900 {**
901 * Allow the screen to be blanked by a screensaver
903 * SDL_IsScreenSaverEnabled()
904 * SDL_DisableScreenSaver()
905 *}
907 procedure SDL_EnableScreenSaver cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_EnableScreenSaver' {$ENDIF} {$ENDIF};
909 {**
910 * Prevent the screen from being blanked by a screensaver
912 * SDL_IsScreenSaverEnabled()
913 * SDL_EnableScreenSaver()
914 *}
916 procedure SDL_DisableScreenSaver cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_DisableScreenSaver' {$ENDIF} {$ENDIF};
918 {**
919 * OpenGL support functions
920 *}
922 {**
923 * Dynamically load an OpenGL library.
925 * path The platform dependent OpenGL library name, or nil to open the
926 * default OpenGL library.
928 * 0 on success, or -1 if the library couldn't be loaded.
930 * This should be done after initializing the video driver, but before
931 * creating any OpenGL windows. If no OpenGL library is loaded, the default
932 * library will be loaded upon creation of the first OpenGL window.
934 * If you do this, you need to retrieve all of the GL functions used in
935 * your program from the dynamic library using SDL_GL_GetProcAddress().
937 * SDL_GL_GetProcAddress()
938 * SDL_GL_UnloadLibrary()
939 *}
941 function SDL_GL_LoadLibrary(const path: PAnsiChar): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_LoadLibrary' {$ENDIF} {$ENDIF};
943 {**
944 * Get the address of an OpenGL function.
945 *}
947 function SDL_GL_GetProcAddress(const proc: PAnsiChar): Pointer cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetProcAddress' {$ENDIF} {$ENDIF};
949 {**
950 * Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary().
952 * SDL_GL_LoadLibrary()
953 *}
955 procedure SDL_GL_UnloadLibrary cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_UnloadLibrary' {$ENDIF} {$ENDIF};
957 {**
958 * Return true if an OpenGL extension is supported for the current
959 * context.
960 *}
962 function SDL_GL_ExtensionSupported(const extension: PAnsiChar): TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_ExtensionSupported' {$ENDIF} {$ENDIF};
964 {**
965 * Reset all previously set OpenGL context attributes to their default values
966 *}
967 procedure SDL_GL_ResetAttributes(); cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_ResetAttributes' {$ENDIF} {$ENDIF};
969 {**
970 * Set an OpenGL window attribute before window creation.
971 *}
973 function SDL_GL_SetAttribute(attr: TSDL_GLattr; value: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_SetAttribute' {$ENDIF} {$ENDIF};
975 {**
976 * Get the actual value for an attribute from the current context.
977 *}
979 function SDL_GL_GetAttribute(attr: TSDL_GLattr; value: PInt): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetAttribute' {$ENDIF} {$ENDIF};
981 {**
982 * Create an OpenGL context for use with an OpenGL window, and make it
983 * current.
985 * SDL_GL_DeleteContext()
986 *}
988 function SDL_GL_CreateContext(window: PSDL_Window): TSDL_GLContext cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_CreateContext' {$ENDIF} {$ENDIF};
990 {**
991 * Set up an OpenGL context for rendering into an OpenGL window.
993 * The context must have been created with a compatible window.
994 *}
996 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};
998 {**
999 * Get the currently active OpenGL window.
1000 *}
1001 function SDL_GL_GetCurrentWindow: PSDL_Window cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetCurrentWindow' {$ENDIF} {$ENDIF};
1003 {**
1004 * Get the currently active OpenGL context.
1005 *}
1006 function SDL_GL_GetCurrentContext: TSDL_GLContext cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetCurrentContext' {$ENDIF} {$ENDIF};
1008 {**
1009 * Set the swap interval for the current OpenGL context.
1011 * interval 0 for immediate updates, 1 for updates synchronized with the
1012 * vertical retrace. If the system supports it, you may
1013 * specify -1 to allow late swaps to happen immediately
1014 * instead of waiting for the next retrace.
1016 * 0 on success, or -1 if setting the swap interval is not supported.
1018 * SDL_GL_GetSwapInterval()
1019 *}
1021 function SDL_GL_SetSwapInterval(interval: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_SetSwapInterval' {$ENDIF} {$ENDIF};
1023 {**
1024 * Get the swap interval for the current OpenGL context.
1026 * 0 if there is no vertical retrace synchronization, 1 if the buffer
1027 * swap is synchronized with the vertical retrace, and -1 if late
1028 * swaps happen immediately instead of waiting for the next retrace.
1029 * If the system can't determine the swap interval, or there isn't a
1030 * valid current context, this will return 0 as a safe default.
1032 * SDL_GL_SetSwapInterval()
1033 *}
1035 function SDL_GL_GetSwapInterval: SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_GetSwapInterval' {$ENDIF} {$ENDIF};
1037 {**
1038 * Swap the OpenGL buffers for a window, if double-buffering is
1039 * supported.
1040 *}
1042 procedure SDL_GL_SwapWindow(window: PSDL_Window) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_SwapWindow' {$ENDIF} {$ENDIF};
1044 {**
1045 * Delete an OpenGL context.
1047 * SDL_GL_CreateContext()
1048 *}
1050 procedure SDL_GL_DeleteContext(context: TSDL_GLContext) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_DeleteContext' {$ENDIF} {$ENDIF};
1052 {*OpenGL support functions*}