My Project
SDL_video.h
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any damages
7  arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 
28 #ifndef SDL_video_h_
29 #define SDL_video_h_
30 
31 #include "SDL_stdinc.h"
32 #include "SDL_pixels.h"
33 #include "SDL_rect.h"
34 #include "SDL_surface.h"
35 
36 #include "begin_code.h"
37 /* Set up for C function definitions, even when using C++ */
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
53 typedef struct
54 {
55  Uint32 format;
56  int w;
57  int h;
59  void *driverdata;
61 
90 typedef struct SDL_Window SDL_Window;
91 
97 typedef enum
98 {
99  SDL_WINDOW_FULLSCREEN = 0x00000001,
100  SDL_WINDOW_OPENGL = 0x00000002,
101  SDL_WINDOW_SHOWN = 0x00000004,
102  SDL_WINDOW_HIDDEN = 0x00000008,
103  SDL_WINDOW_BORDERLESS = 0x00000010,
104  SDL_WINDOW_RESIZABLE = 0x00000020,
105  SDL_WINDOW_MINIMIZED = 0x00000040,
106  SDL_WINDOW_MAXIMIZED = 0x00000080,
108  SDL_WINDOW_INPUT_FOCUS = 0x00000200,
109  SDL_WINDOW_MOUSE_FOCUS = 0x00000400,
110  SDL_WINDOW_FULLSCREEN_DESKTOP = ( SDL_WINDOW_FULLSCREEN | 0x00001000 ),
111  SDL_WINDOW_FOREIGN = 0x00000800,
112  SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000,
117  SDL_WINDOW_SKIP_TASKBAR = 0x00010000,
118  SDL_WINDOW_UTILITY = 0x00020000,
119  SDL_WINDOW_TOOLTIP = 0x00040000,
120  SDL_WINDOW_POPUP_MENU = 0x00080000,
121  SDL_WINDOW_VULKAN = 0x10000000,
122  SDL_WINDOW_METAL = 0x20000000
124 
128 #define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000u
129 #define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) (SDL_WINDOWPOS_UNDEFINED_MASK|(X))
130 #define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0)
131 #define SDL_WINDOWPOS_ISUNDEFINED(X) \
132  (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK)
133 
137 #define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000u
138 #define SDL_WINDOWPOS_CENTERED_DISPLAY(X) (SDL_WINDOWPOS_CENTERED_MASK|(X))
139 #define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0)
140 #define SDL_WINDOWPOS_ISCENTERED(X) \
141  (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK)
142 
146 typedef enum
147 {
171 
175 typedef enum
176 {
182 
183 typedef enum
184 {
191 
195 typedef void *SDL_GLContext;
196 
200 typedef enum
201 {
202  SDL_GL_RED_SIZE,
203  SDL_GL_GREEN_SIZE,
204  SDL_GL_BLUE_SIZE,
205  SDL_GL_ALPHA_SIZE,
206  SDL_GL_BUFFER_SIZE,
207  SDL_GL_DOUBLEBUFFER,
208  SDL_GL_DEPTH_SIZE,
209  SDL_GL_STENCIL_SIZE,
210  SDL_GL_ACCUM_RED_SIZE,
211  SDL_GL_ACCUM_GREEN_SIZE,
212  SDL_GL_ACCUM_BLUE_SIZE,
213  SDL_GL_ACCUM_ALPHA_SIZE,
214  SDL_GL_STEREO,
215  SDL_GL_MULTISAMPLEBUFFERS,
216  SDL_GL_MULTISAMPLESAMPLES,
217  SDL_GL_ACCELERATED_VISUAL,
218  SDL_GL_RETAINED_BACKING,
219  SDL_GL_CONTEXT_MAJOR_VERSION,
220  SDL_GL_CONTEXT_MINOR_VERSION,
221  SDL_GL_CONTEXT_EGL,
222  SDL_GL_CONTEXT_FLAGS,
223  SDL_GL_CONTEXT_PROFILE_MASK,
224  SDL_GL_SHARE_WITH_CURRENT_CONTEXT,
225  SDL_GL_FRAMEBUFFER_SRGB_CAPABLE,
226  SDL_GL_CONTEXT_RELEASE_BEHAVIOR,
227  SDL_GL_CONTEXT_RESET_NOTIFICATION,
228  SDL_GL_CONTEXT_NO_ERROR
229 } SDL_GLattr;
230 
231 typedef enum
232 {
233  SDL_GL_CONTEXT_PROFILE_CORE = 0x0001,
234  SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002,
235  SDL_GL_CONTEXT_PROFILE_ES = 0x0004
237 
238 typedef enum
239 {
240  SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001,
241  SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002,
242  SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004,
243  SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008
244 } SDL_GLcontextFlag;
245 
246 typedef enum
247 {
248  SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0x0000,
249  SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x0001
250 } SDL_GLcontextReleaseFlag;
251 
252 typedef enum
253 {
254  SDL_GL_CONTEXT_RESET_NO_NOTIFICATION = 0x0000,
255  SDL_GL_CONTEXT_RESET_LOSE_CONTEXT = 0x0001
256 } SDL_GLContextResetNotification;
257 
258 /* Function prototypes */
259 
265 extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void);
266 
275 extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index);
276 
291 extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name);
292 
300 extern DECLSPEC void SDLCALL SDL_VideoQuit(void);
301 
311 extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void);
312 
318 extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void);
319 
327 extern DECLSPEC const char * SDLCALL SDL_GetDisplayName(int displayIndex);
328 
337 extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect);
338 
356 extern DECLSPEC int SDLCALL SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect * rect);
357 
368 extern DECLSPEC int SDLCALL SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi);
369 
377 extern DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetDisplayOrientation(int displayIndex);
378 
384 extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(int displayIndex);
385 
397 extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int displayIndex, int modeIndex,
398  SDL_DisplayMode * mode);
399 
403 extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode);
404 
408 extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode);
409 
410 
432 extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest);
433 
440 extern DECLSPEC int SDLCALL SDL_GetWindowDisplayIndex(SDL_Window * window);
441 
456 extern DECLSPEC int SDLCALL SDL_SetWindowDisplayMode(SDL_Window * window,
457  const SDL_DisplayMode
458  * mode);
459 
467 extern DECLSPEC int SDLCALL SDL_GetWindowDisplayMode(SDL_Window * window,
468  SDL_DisplayMode * mode);
469 
473 extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window);
474 
521 extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title,
522  int x, int y, int w,
523  int h, Uint32 flags);
524 
534 extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowFrom(const void *data);
535 
539 extern DECLSPEC Uint32 SDLCALL SDL_GetWindowID(SDL_Window * window);
540 
544 extern DECLSPEC SDL_Window * SDLCALL SDL_GetWindowFromID(Uint32 id);
545 
549 extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_Window * window);
550 
556 extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_Window * window,
557  const char *title);
558 
564 extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window * window);
565 
572 extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_Window * window,
573  SDL_Surface * icon);
574 
588 extern DECLSPEC void* SDLCALL SDL_SetWindowData(SDL_Window * window,
589  const char *name,
590  void *userdata);
591 
602 extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window * window,
603  const char *name);
604 
618 extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_Window * window,
619  int x, int y);
620 
632 extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_Window * window,
633  int *x, int *y);
634 
653 extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_Window * window, int w,
654  int h);
655 
672 extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_Window * window, int *w,
673  int *h);
674 
690 extern DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window * window,
691  int *top, int *left,
692  int *bottom, int *right);
693 
707 extern DECLSPEC void SDLCALL SDL_SetWindowMinimumSize(SDL_Window * window,
708  int min_w, int min_h);
709 
720 extern DECLSPEC void SDLCALL SDL_GetWindowMinimumSize(SDL_Window * window,
721  int *w, int *h);
722 
736 extern DECLSPEC void SDLCALL SDL_SetWindowMaximumSize(SDL_Window * window,
737  int max_w, int max_h);
738 
749 extern DECLSPEC void SDLCALL SDL_GetWindowMaximumSize(SDL_Window * window,
750  int *w, int *h);
751 
766 extern DECLSPEC void SDLCALL SDL_SetWindowBordered(SDL_Window * window,
767  SDL_bool bordered);
768 
783 extern DECLSPEC void SDLCALL SDL_SetWindowResizable(SDL_Window * window,
784  SDL_bool resizable);
785 
791 extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_Window * window);
792 
798 extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_Window * window);
799 
803 extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_Window * window);
804 
810 extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_Window * window);
811 
817 extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_Window * window);
818 
825 extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window * window);
826 
835 extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window,
836  Uint32 flags);
837 
851 extern DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window * window);
852 
861 extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window);
862 
871 extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window,
872  const SDL_Rect * rects,
873  int numrects);
874 
886 extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window * window,
887  SDL_bool grabbed);
888 
896 extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowGrab(SDL_Window * window);
897 
905 extern DECLSPEC SDL_Window * SDLCALL SDL_GetGrabbedWindow(void);
906 
915 extern DECLSPEC int SDLCALL SDL_SetWindowBrightness(SDL_Window * window, float brightness);
916 
924 extern DECLSPEC float SDLCALL SDL_GetWindowBrightness(SDL_Window * window);
925 
937 extern DECLSPEC int SDLCALL SDL_SetWindowOpacity(SDL_Window * window, float opacity);
938 
952 extern DECLSPEC int SDLCALL SDL_GetWindowOpacity(SDL_Window * window, float * out_opacity);
953 
962 extern DECLSPEC int SDLCALL SDL_SetWindowModalFor(SDL_Window * modal_window, SDL_Window * parent_window);
963 
976 extern DECLSPEC int SDLCALL SDL_SetWindowInputFocus(SDL_Window * window);
977 
996 extern DECLSPEC int SDLCALL SDL_SetWindowGammaRamp(SDL_Window * window,
997  const Uint16 * red,
998  const Uint16 * green,
999  const Uint16 * blue);
1000 
1016 extern DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window * window,
1017  Uint16 * red,
1018  Uint16 * green,
1019  Uint16 * blue);
1020 
1026 typedef enum
1027 {
1030  SDL_HITTEST_RESIZE_TOPLEFT,
1031  SDL_HITTEST_RESIZE_TOP,
1032  SDL_HITTEST_RESIZE_TOPRIGHT,
1033  SDL_HITTEST_RESIZE_RIGHT,
1034  SDL_HITTEST_RESIZE_BOTTOMRIGHT,
1035  SDL_HITTEST_RESIZE_BOTTOM,
1036  SDL_HITTEST_RESIZE_BOTTOMLEFT,
1037  SDL_HITTEST_RESIZE_LEFT
1039 
1045 typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win,
1046  const SDL_Point *area,
1047  void *data);
1048 
1086 extern DECLSPEC int SDLCALL SDL_SetWindowHitTest(SDL_Window * window,
1087  SDL_HitTest callback,
1088  void *callback_data);
1089 
1093 extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window * window);
1094 
1095 
1102 extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void);
1103 
1110 extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void);
1111 
1118 extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void);
1119 
1120 
1124 /* @{ */
1125 
1144 extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
1145 
1149 extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc);
1150 
1156 extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void);
1157 
1162 extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char
1163  *extension);
1164 
1168 extern DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void);
1169 
1175 extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
1176 
1183 extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value);
1184 
1192  window);
1193 
1199 extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_Window * window,
1200  SDL_GLContext context);
1201 
1205 extern DECLSPEC SDL_Window* SDLCALL SDL_GL_GetCurrentWindow(void);
1206 
1210 extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void);
1211 
1228 extern DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window * window, int *w,
1229  int *h);
1230 
1243 extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval);
1244 
1256 extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void);
1257 
1262 extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_Window * window);
1263 
1269 extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context);
1270 
1271 /* @} *//* OpenGL support functions */
1272 
1273 
1274 /* Ends C function definitions when using C++ */
1275 #ifdef __cplusplus
1276 }
1277 #endif
1278 #include "close_code.h"
1279 
1280 #endif /* SDL_video_h_ */
1281 
1282 /* vi: set ts=4 sw=4 expandtab: */
DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_Window *window, int *x, int *y)
Get the position of a window.
SDL_HitTestResult
Possible return values from the SDL_HitTest callback.
Definition: SDL_video.h:1027
@ SDL_HITTEST_DRAGGABLE
Definition: SDL_video.h:1029
@ SDL_HITTEST_NORMAL
Definition: SDL_video.h:1028
DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name)
Initialize the video subsystem, optionally specifying a video driver.
DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void)
Returns the number of available video displays.
DECLSPEC int SDLCALL SDL_GetDisplayMode(int displayIndex, int modeIndex, SDL_DisplayMode *mode)
Fill in information about a specific display mode.
DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_Window *window, SDL_Surface *icon)
Set the icon for a window.
DECLSPEC int SDLCALL SDL_GetWindowDisplayIndex(SDL_Window *window)
Get the display index associated with a window.
void * SDL_GLContext
An opaque handle to an OpenGL context.
Definition: SDL_video.h:195
DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window *window)
Create an OpenGL context for use with an OpenGL window, and make it current.
DECLSPEC SDL_Surface *SDLCALL SDL_GetWindowSurface(SDL_Window *window)
Get the SDL surface associated with the window.
DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_Window *window)
Swap the OpenGL buffers for a window, if double-buffering is supported.
DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode *mode)
Fill in information about the current display mode.
DECLSPEC void SDLCALL SDL_EnableScreenSaver(void)
Allow the screen to be blanked by a screensaver.
DECLSPEC void SDLCALL SDL_SetWindowMinimumSize(SDL_Window *window, int min_w, int min_h)
Set the minimum size of a window's client area.
DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window *window)
Get the title of a window, in UTF-8 format.
DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window *window, int *top, int *left, int *bottom, int *right)
Get the size of a window's borders (decorations) around the client area.
DECLSPEC Uint32 SDLCALL SDL_GetWindowID(SDL_Window *window)
Get the numeric ID of a window, for logging purposes.
DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char *extension)
Return true if an OpenGL extension is supported for the current context.
DECLSPEC float SDLCALL SDL_GetWindowBrightness(SDL_Window *window)
Get the brightness (gamma correction) for a window.
DECLSPEC int SDLCALL SDL_SetWindowHitTest(SDL_Window *window, SDL_HitTest callback, void *callback_data)
Provide a callback that decides if a window region has special properties.
SDL_HitTestResult(SDLCALL * SDL_HitTest)(SDL_Window *win, const SDL_Point *area, void *data)
Callback used for hit-testing.
Definition: SDL_video.h:1045
DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_Window *window, int w, int h)
Set the size of a window's client area.
DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index)
Get the name of a built in video driver.
DECLSPEC int SDLCALL SDL_SetWindowDisplayMode(SDL_Window *window, const SDL_DisplayMode *mode)
Set the display mode used when a fullscreen window is visible.
SDL_GLattr
OpenGL configuration attributes.
Definition: SDL_video.h:201
DECLSPEC const char *SDLCALL SDL_GetDisplayName(int displayIndex)
Get the name of a display in UTF-8 encoding.
DECLSPEC void SDLCALL SDL_GetWindowMaximumSize(SDL_Window *window, int *w, int *h)
Get the maximum size of a window's client area.
DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path)
Dynamically load an OpenGL library.
DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window *window)
Get the pixel format associated with the window.
DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_Window *window, const char *title)
Set the title of a window, in UTF-8 format.
DECLSPEC SDL_Window *SDLCALL SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
Create a window with the specified position, dimensions, and flags.
DECLSPEC void SDLCALL SDL_SetWindowResizable(SDL_Window *window, SDL_bool resizable)
Set the user-resizable state of a window.
DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_Window *window)
Get the window flags.
DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void)
Returns whether the screensaver is currently enabled (default off).
DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_Window *window)
Raise a window above other windows and set the input focus.
DECLSPEC SDL_Window *SDLCALL SDL_CreateWindowFrom(const void *data)
Create an SDL window from an existing native window.
struct SDL_Window SDL_Window
The type used to identify a window.
Definition: SDL_video.h:90
DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_Window *window, SDL_GLContext context)
Set up an OpenGL context for rendering into an OpenGL window.
DECLSPEC int SDLCALL SDL_GetNumDisplayModes(int displayIndex)
Returns the number of available display modes.
DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_Window *window, int *w, int *h)
Get the size of a window's client area.
DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void)
Returns the name of the currently initialized video driver.
DECLSPEC void SDLCALL SDL_ShowWindow(SDL_Window *window)
Show a window.
DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value)
Get the actual value for an attribute from the current context.
DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc)
Get the address of an OpenGL function.
DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetDisplayOrientation(int displayIndex)
Get the orientation of a display.
DECLSPEC int SDLCALL SDL_SetWindowGammaRamp(SDL_Window *window, const Uint16 *red, const Uint16 *green, const Uint16 *blue)
Set the gamma ramp for a window.
DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval)
Set the swap interval for the current OpenGL context.
DECLSPEC void SDLCALL SDL_DisableScreenSaver(void)
Prevent the screen from being blanked by a screensaver.
DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window *window)
Destroy a window.
DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void)
Get the currently active OpenGL context.
DECLSPEC SDL_DisplayMode *SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode *mode, SDL_DisplayMode *closest)
Get the closest match to the requested display mode.
DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window *window)
Copy the window surface to the screen.
DECLSPEC int SDLCALL SDL_GetWindowDisplayMode(SDL_Window *window, SDL_DisplayMode *mode)
Fill in information about the display mode used when a fullscreen window is visible.
DECLSPEC int SDLCALL SDL_GetDisplayDPI(int displayIndex, float *ddpi, float *hdpi, float *vdpi)
Get the dots/pixels-per-inch for a display.
DECLSPEC int SDLCALL SDL_SetWindowBrightness(SDL_Window *window, float brightness)
Set the brightness (gamma correction) for a window.
DECLSPEC SDL_Window *SDLCALL SDL_GetGrabbedWindow(void)
Get the window that currently has an input grab enabled.
DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_Window *window)
Make a window as large as possible.
DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void)
Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary().
DECLSPEC int SDLCALL SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect *rect)
Get the usable desktop area represented by a display, with the primary display located at 0,...
DECLSPEC SDL_Window *SDLCALL SDL_GL_GetCurrentWindow(void)
Get the currently active OpenGL window.
DECLSPEC int SDLCALL SDL_GetWindowOpacity(SDL_Window *window, float *out_opacity)
Get the opacity of a window.
DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_Window *window)
Minimize a window to an iconic representation.
DECLSPEC void SDLCALL SDL_HideWindow(SDL_Window *window)
Hide a window.
DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context)
Delete an OpenGL context.
DECLSPEC int SDLCALL SDL_SetWindowInputFocus(SDL_Window *window)
Explicitly sets input focus to the window.
DECLSPEC void SDLCALL SDL_SetWindowMaximumSize(SDL_Window *window, int max_w, int max_h)
Set the maximum size of a window's client area.
SDL_WindowFlags
The flags on a window.
Definition: SDL_video.h:98
@ SDL_WINDOW_ALLOW_HIGHDPI
Definition: SDL_video.h:112
@ SDL_WINDOW_FOREIGN
Definition: SDL_video.h:111
@ SDL_WINDOW_TOOLTIP
Definition: SDL_video.h:119
@ SDL_WINDOW_ALWAYS_ON_TOP
Definition: SDL_video.h:116
@ SDL_WINDOW_SHOWN
Definition: SDL_video.h:101
@ SDL_WINDOW_SKIP_TASKBAR
Definition: SDL_video.h:117
@ SDL_WINDOW_MOUSE_CAPTURE
Definition: SDL_video.h:115
@ SDL_WINDOW_VULKAN
Definition: SDL_video.h:121
@ SDL_WINDOW_OPENGL
Definition: SDL_video.h:100
@ SDL_WINDOW_MINIMIZED
Definition: SDL_video.h:105
@ SDL_WINDOW_UTILITY
Definition: SDL_video.h:118
@ SDL_WINDOW_MOUSE_FOCUS
Definition: SDL_video.h:109
@ SDL_WINDOW_INPUT_GRABBED
Definition: SDL_video.h:107
@ SDL_WINDOW_RESIZABLE
Definition: SDL_video.h:104
@ SDL_WINDOW_FULLSCREEN
Definition: SDL_video.h:99
@ SDL_WINDOW_MAXIMIZED
Definition: SDL_video.h:106
@ SDL_WINDOW_METAL
Definition: SDL_video.h:122
@ SDL_WINDOW_HIDDEN
Definition: SDL_video.h:102
@ SDL_WINDOW_POPUP_MENU
Definition: SDL_video.h:120
@ SDL_WINDOW_BORDERLESS
Definition: SDL_video.h:103
@ SDL_WINDOW_INPUT_FOCUS
Definition: SDL_video.h:108
DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_Window *window, int x, int y)
Set the position of a window.
DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window *window, Uint32 flags)
Set a window's fullscreen state.
DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode *mode)
Fill in information about the desktop display mode.
DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window *window, SDL_bool grabbed)
Set a window's input grab mode.
DECLSPEC int SDLCALL SDL_GetDisplayBounds(int displayIndex, SDL_Rect *rect)
Get the desktop area represented by a display, with the primary display located at 0,...
DECLSPEC int SDLCALL SDL_SetWindowOpacity(SDL_Window *window, float opacity)
Set the opacity for a window.
DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window *window, int *w, int *h)
Get the size of a window's underlying drawable in pixels (for use with glViewport).
SDL_WindowEventID
Event subtype for window events.
Definition: SDL_video.h:147
@ SDL_WINDOWEVENT_HIDDEN
Definition: SDL_video.h:150
@ SDL_WINDOWEVENT_FOCUS_LOST
Definition: SDL_video.h:166
@ SDL_WINDOWEVENT_CLOSE
Definition: SDL_video.h:167
@ SDL_WINDOWEVENT_RESIZED
Definition: SDL_video.h:155
@ SDL_WINDOWEVENT_HIT_TEST
Definition: SDL_video.h:169
@ SDL_WINDOWEVENT_FOCUS_GAINED
Definition: SDL_video.h:165
@ SDL_WINDOWEVENT_SHOWN
Definition: SDL_video.h:149
@ SDL_WINDOWEVENT_MOVED
Definition: SDL_video.h:153
@ SDL_WINDOWEVENT_TAKE_FOCUS
Definition: SDL_video.h:168
@ SDL_WINDOWEVENT_MINIMIZED
Definition: SDL_video.h:159
@ SDL_WINDOWEVENT_LEAVE
Definition: SDL_video.h:164
@ SDL_WINDOWEVENT_MAXIMIZED
Definition: SDL_video.h:160
@ SDL_WINDOWEVENT_SIZE_CHANGED
Definition: SDL_video.h:156
@ SDL_WINDOWEVENT_RESTORED
Definition: SDL_video.h:161
@ SDL_WINDOWEVENT_EXPOSED
Definition: SDL_video.h:151
@ SDL_WINDOWEVENT_ENTER
Definition: SDL_video.h:163
@ SDL_WINDOWEVENT_NONE
Definition: SDL_video.h:148
DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void)
Get the number of video drivers compiled into SDL.
DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void)
Reset all previously set OpenGL context attributes to their default values.
DECLSPEC SDL_bool SDLCALL SDL_GetWindowGrab(SDL_Window *window)
Get a window's input grab mode.
SDL_GLprofile
Definition: SDL_video.h:232
@ SDL_GL_CONTEXT_PROFILE_ES
Definition: SDL_video.h:235
SDL_DisplayEventID
Event subtype for display events.
Definition: SDL_video.h:176
@ SDL_DISPLAYEVENT_NONE
Definition: SDL_video.h:177
@ SDL_DISPLAYEVENT_ORIENTATION
Definition: SDL_video.h:178
@ SDL_DISPLAYEVENT_DISCONNECTED
Definition: SDL_video.h:180
@ SDL_DISPLAYEVENT_CONNECTED
Definition: SDL_video.h:179
DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window *window, const char *name)
Retrieve the data pointer associated with a window.
DECLSPEC SDL_Window *SDLCALL SDL_GetWindowFromID(Uint32 id)
Get a window from a stored ID, or NULL if it doesn't exist.
DECLSPEC void SDLCALL SDL_VideoQuit(void)
Shuts down the video subsystem.
DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window *window, const SDL_Rect *rects, int numrects)
Copy a number of rectangles on the window surface to the screen.
DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void)
Get the swap interval for the current OpenGL context.
DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value)
Set an OpenGL window attribute before window creation.
SDL_DisplayOrientation
Definition: SDL_video.h:184
@ SDL_ORIENTATION_LANDSCAPE
Definition: SDL_video.h:186
@ SDL_ORIENTATION_PORTRAIT
Definition: SDL_video.h:188
@ SDL_ORIENTATION_PORTRAIT_FLIPPED
Definition: SDL_video.h:189
@ SDL_ORIENTATION_LANDSCAPE_FLIPPED
Definition: SDL_video.h:187
@ SDL_ORIENTATION_UNKNOWN
Definition: SDL_video.h:185
DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window *window, Uint16 *red, Uint16 *green, Uint16 *blue)
Get the gamma ramp for a window.
DECLSPEC void SDLCALL SDL_SetWindowBordered(SDL_Window *window, SDL_bool bordered)
Set the border state of a window.
DECLSPEC int SDLCALL SDL_SetWindowModalFor(SDL_Window *modal_window, SDL_Window *parent_window)
Sets the window as a modal for another window (TODO: reconsider this function and/or its name)
DECLSPEC void *SDLCALL SDL_SetWindowData(SDL_Window *window, const char *name, void *userdata)
Associate an arbitrary named pointer with a window.
DECLSPEC void SDLCALL SDL_GetWindowMinimumSize(SDL_Window *window, int *w, int *h)
Get the minimum size of a window's client area.
DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window *window)
Restore the size and position of a minimized or maximized window.
The structure that defines a display mode.
Definition: SDL_video.h:54
int h
Definition: SDL_video.h:57
void * driverdata
Definition: SDL_video.h:59
int w
Definition: SDL_video.h:56
int refresh_rate
Definition: SDL_video.h:58
Uint32 format
Definition: SDL_video.h:55
The structure that defines a point (integer)
Definition: SDL_rect.h:49
A rectangle, with the origin at the upper left (integer).
Definition: SDL_rect.h:78
A collection of pixels used in software blitting.
Definition: SDL_surface.h:71