SDL Library
SDL_video.h@0:7fb6877b5d7c, 2016-09-22 (annotated)
- Committer:
- miruga27
- Date:
- Thu Sep 22 00:03:09 2016 +0000
- Revision:
- 0:7fb6877b5d7c
SDL
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
miruga27 | 0:7fb6877b5d7c | 1 | /* |
miruga27 | 0:7fb6877b5d7c | 2 | Simple DirectMedia Layer |
miruga27 | 0:7fb6877b5d7c | 3 | Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org> |
miruga27 | 0:7fb6877b5d7c | 4 | |
miruga27 | 0:7fb6877b5d7c | 5 | This software is provided 'as-is', without any express or implied |
miruga27 | 0:7fb6877b5d7c | 6 | warranty. In no event will the authors be held liable for any damages |
miruga27 | 0:7fb6877b5d7c | 7 | arising from the use of this software. |
miruga27 | 0:7fb6877b5d7c | 8 | |
miruga27 | 0:7fb6877b5d7c | 9 | Permission is granted to anyone to use this software for any purpose, |
miruga27 | 0:7fb6877b5d7c | 10 | including commercial applications, and to alter it and redistribute it |
miruga27 | 0:7fb6877b5d7c | 11 | freely, subject to the following restrictions: |
miruga27 | 0:7fb6877b5d7c | 12 | |
miruga27 | 0:7fb6877b5d7c | 13 | 1. The origin of this software must not be misrepresented; you must not |
miruga27 | 0:7fb6877b5d7c | 14 | claim that you wrote the original software. If you use this software |
miruga27 | 0:7fb6877b5d7c | 15 | in a product, an acknowledgment in the product documentation would be |
miruga27 | 0:7fb6877b5d7c | 16 | appreciated but is not required. |
miruga27 | 0:7fb6877b5d7c | 17 | 2. Altered source versions must be plainly marked as such, and must not be |
miruga27 | 0:7fb6877b5d7c | 18 | misrepresented as being the original software. |
miruga27 | 0:7fb6877b5d7c | 19 | 3. This notice may not be removed or altered from any source distribution. |
miruga27 | 0:7fb6877b5d7c | 20 | */ |
miruga27 | 0:7fb6877b5d7c | 21 | |
miruga27 | 0:7fb6877b5d7c | 22 | /** |
miruga27 | 0:7fb6877b5d7c | 23 | * \file SDL_video.h |
miruga27 | 0:7fb6877b5d7c | 24 | * |
miruga27 | 0:7fb6877b5d7c | 25 | * Header file for SDL video functions. |
miruga27 | 0:7fb6877b5d7c | 26 | */ |
miruga27 | 0:7fb6877b5d7c | 27 | |
miruga27 | 0:7fb6877b5d7c | 28 | #ifndef _SDL_video_h |
miruga27 | 0:7fb6877b5d7c | 29 | #define _SDL_video_h |
miruga27 | 0:7fb6877b5d7c | 30 | |
miruga27 | 0:7fb6877b5d7c | 31 | #include "SDL_stdinc.h" |
miruga27 | 0:7fb6877b5d7c | 32 | #include "SDL_pixels.h" |
miruga27 | 0:7fb6877b5d7c | 33 | #include "SDL_rect.h" |
miruga27 | 0:7fb6877b5d7c | 34 | #include "SDL_surface.h" |
miruga27 | 0:7fb6877b5d7c | 35 | |
miruga27 | 0:7fb6877b5d7c | 36 | #include "begin_code.h" |
miruga27 | 0:7fb6877b5d7c | 37 | /* Set up for C function definitions, even when using C++ */ |
miruga27 | 0:7fb6877b5d7c | 38 | #ifdef __cplusplus |
miruga27 | 0:7fb6877b5d7c | 39 | extern "C" { |
miruga27 | 0:7fb6877b5d7c | 40 | #endif |
miruga27 | 0:7fb6877b5d7c | 41 | |
miruga27 | 0:7fb6877b5d7c | 42 | /** |
miruga27 | 0:7fb6877b5d7c | 43 | * \brief The structure that defines a display mode |
miruga27 | 0:7fb6877b5d7c | 44 | * |
miruga27 | 0:7fb6877b5d7c | 45 | * \sa SDL_GetNumDisplayModes() |
miruga27 | 0:7fb6877b5d7c | 46 | * \sa SDL_GetDisplayMode() |
miruga27 | 0:7fb6877b5d7c | 47 | * \sa SDL_GetDesktopDisplayMode() |
miruga27 | 0:7fb6877b5d7c | 48 | * \sa SDL_GetCurrentDisplayMode() |
miruga27 | 0:7fb6877b5d7c | 49 | * \sa SDL_GetClosestDisplayMode() |
miruga27 | 0:7fb6877b5d7c | 50 | * \sa SDL_SetWindowDisplayMode() |
miruga27 | 0:7fb6877b5d7c | 51 | * \sa SDL_GetWindowDisplayMode() |
miruga27 | 0:7fb6877b5d7c | 52 | */ |
miruga27 | 0:7fb6877b5d7c | 53 | typedef struct |
miruga27 | 0:7fb6877b5d7c | 54 | { |
miruga27 | 0:7fb6877b5d7c | 55 | Uint32 format; /**< pixel format */ |
miruga27 | 0:7fb6877b5d7c | 56 | int w; /**< width */ |
miruga27 | 0:7fb6877b5d7c | 57 | int h; /**< height */ |
miruga27 | 0:7fb6877b5d7c | 58 | int refresh_rate; /**< refresh rate (or zero for unspecified) */ |
miruga27 | 0:7fb6877b5d7c | 59 | void *driverdata; /**< driver-specific data, initialize to 0 */ |
miruga27 | 0:7fb6877b5d7c | 60 | } SDL_DisplayMode; |
miruga27 | 0:7fb6877b5d7c | 61 | |
miruga27 | 0:7fb6877b5d7c | 62 | /** |
miruga27 | 0:7fb6877b5d7c | 63 | * \brief The type used to identify a window |
miruga27 | 0:7fb6877b5d7c | 64 | * |
miruga27 | 0:7fb6877b5d7c | 65 | * \sa SDL_CreateWindow() |
miruga27 | 0:7fb6877b5d7c | 66 | * \sa SDL_CreateWindowFrom() |
miruga27 | 0:7fb6877b5d7c | 67 | * \sa SDL_DestroyWindow() |
miruga27 | 0:7fb6877b5d7c | 68 | * \sa SDL_GetWindowData() |
miruga27 | 0:7fb6877b5d7c | 69 | * \sa SDL_GetWindowFlags() |
miruga27 | 0:7fb6877b5d7c | 70 | * \sa SDL_GetWindowGrab() |
miruga27 | 0:7fb6877b5d7c | 71 | * \sa SDL_GetWindowPosition() |
miruga27 | 0:7fb6877b5d7c | 72 | * \sa SDL_GetWindowSize() |
miruga27 | 0:7fb6877b5d7c | 73 | * \sa SDL_GetWindowTitle() |
miruga27 | 0:7fb6877b5d7c | 74 | * \sa SDL_HideWindow() |
miruga27 | 0:7fb6877b5d7c | 75 | * \sa SDL_MaximizeWindow() |
miruga27 | 0:7fb6877b5d7c | 76 | * \sa SDL_MinimizeWindow() |
miruga27 | 0:7fb6877b5d7c | 77 | * \sa SDL_RaiseWindow() |
miruga27 | 0:7fb6877b5d7c | 78 | * \sa SDL_RestoreWindow() |
miruga27 | 0:7fb6877b5d7c | 79 | * \sa SDL_SetWindowData() |
miruga27 | 0:7fb6877b5d7c | 80 | * \sa SDL_SetWindowFullscreen() |
miruga27 | 0:7fb6877b5d7c | 81 | * \sa SDL_SetWindowGrab() |
miruga27 | 0:7fb6877b5d7c | 82 | * \sa SDL_SetWindowIcon() |
miruga27 | 0:7fb6877b5d7c | 83 | * \sa SDL_SetWindowPosition() |
miruga27 | 0:7fb6877b5d7c | 84 | * \sa SDL_SetWindowSize() |
miruga27 | 0:7fb6877b5d7c | 85 | * \sa SDL_SetWindowBordered() |
miruga27 | 0:7fb6877b5d7c | 86 | * \sa SDL_SetWindowTitle() |
miruga27 | 0:7fb6877b5d7c | 87 | * \sa SDL_ShowWindow() |
miruga27 | 0:7fb6877b5d7c | 88 | */ |
miruga27 | 0:7fb6877b5d7c | 89 | typedef struct SDL_Window SDL_Window; |
miruga27 | 0:7fb6877b5d7c | 90 | |
miruga27 | 0:7fb6877b5d7c | 91 | /** |
miruga27 | 0:7fb6877b5d7c | 92 | * \brief The flags on a window |
miruga27 | 0:7fb6877b5d7c | 93 | * |
miruga27 | 0:7fb6877b5d7c | 94 | * \sa SDL_GetWindowFlags() |
miruga27 | 0:7fb6877b5d7c | 95 | */ |
miruga27 | 0:7fb6877b5d7c | 96 | typedef enum |
miruga27 | 0:7fb6877b5d7c | 97 | { |
miruga27 | 0:7fb6877b5d7c | 98 | SDL_WINDOW_FULLSCREEN = 0x00000001, /**< fullscreen window */ |
miruga27 | 0:7fb6877b5d7c | 99 | SDL_WINDOW_OPENGL = 0x00000002, /**< window usable with OpenGL context */ |
miruga27 | 0:7fb6877b5d7c | 100 | SDL_WINDOW_SHOWN = 0x00000004, /**< window is visible */ |
miruga27 | 0:7fb6877b5d7c | 101 | SDL_WINDOW_HIDDEN = 0x00000008, /**< window is not visible */ |
miruga27 | 0:7fb6877b5d7c | 102 | SDL_WINDOW_BORDERLESS = 0x00000010, /**< no window decoration */ |
miruga27 | 0:7fb6877b5d7c | 103 | SDL_WINDOW_RESIZABLE = 0x00000020, /**< window can be resized */ |
miruga27 | 0:7fb6877b5d7c | 104 | SDL_WINDOW_MINIMIZED = 0x00000040, /**< window is minimized */ |
miruga27 | 0:7fb6877b5d7c | 105 | SDL_WINDOW_MAXIMIZED = 0x00000080, /**< window is maximized */ |
miruga27 | 0:7fb6877b5d7c | 106 | SDL_WINDOW_INPUT_GRABBED = 0x00000100, /**< window has grabbed input focus */ |
miruga27 | 0:7fb6877b5d7c | 107 | SDL_WINDOW_INPUT_FOCUS = 0x00000200, /**< window has input focus */ |
miruga27 | 0:7fb6877b5d7c | 108 | SDL_WINDOW_MOUSE_FOCUS = 0x00000400, /**< window has mouse focus */ |
miruga27 | 0:7fb6877b5d7c | 109 | SDL_WINDOW_FULLSCREEN_DESKTOP = ( SDL_WINDOW_FULLSCREEN | 0x00001000 ), |
miruga27 | 0:7fb6877b5d7c | 110 | SDL_WINDOW_FOREIGN = 0x00000800, /**< window not created by SDL */ |
miruga27 | 0:7fb6877b5d7c | 111 | SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000 /**< window should be created in high-DPI mode if supported */ |
miruga27 | 0:7fb6877b5d7c | 112 | } SDL_WindowFlags; |
miruga27 | 0:7fb6877b5d7c | 113 | |
miruga27 | 0:7fb6877b5d7c | 114 | /** |
miruga27 | 0:7fb6877b5d7c | 115 | * \brief Used to indicate that you don't care what the window position is. |
miruga27 | 0:7fb6877b5d7c | 116 | */ |
miruga27 | 0:7fb6877b5d7c | 117 | #define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000 |
miruga27 | 0:7fb6877b5d7c | 118 | #define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) (SDL_WINDOWPOS_UNDEFINED_MASK|(X)) |
miruga27 | 0:7fb6877b5d7c | 119 | #define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0) |
miruga27 | 0:7fb6877b5d7c | 120 | #define SDL_WINDOWPOS_ISUNDEFINED(X) \ |
miruga27 | 0:7fb6877b5d7c | 121 | (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK) |
miruga27 | 0:7fb6877b5d7c | 122 | |
miruga27 | 0:7fb6877b5d7c | 123 | /** |
miruga27 | 0:7fb6877b5d7c | 124 | * \brief Used to indicate that the window position should be centered. |
miruga27 | 0:7fb6877b5d7c | 125 | */ |
miruga27 | 0:7fb6877b5d7c | 126 | #define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000 |
miruga27 | 0:7fb6877b5d7c | 127 | #define SDL_WINDOWPOS_CENTERED_DISPLAY(X) (SDL_WINDOWPOS_CENTERED_MASK|(X)) |
miruga27 | 0:7fb6877b5d7c | 128 | #define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0) |
miruga27 | 0:7fb6877b5d7c | 129 | #define SDL_WINDOWPOS_ISCENTERED(X) \ |
miruga27 | 0:7fb6877b5d7c | 130 | (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK) |
miruga27 | 0:7fb6877b5d7c | 131 | |
miruga27 | 0:7fb6877b5d7c | 132 | /** |
miruga27 | 0:7fb6877b5d7c | 133 | * \brief Event subtype for window events |
miruga27 | 0:7fb6877b5d7c | 134 | */ |
miruga27 | 0:7fb6877b5d7c | 135 | typedef enum |
miruga27 | 0:7fb6877b5d7c | 136 | { |
miruga27 | 0:7fb6877b5d7c | 137 | SDL_WINDOWEVENT_NONE, /**< Never used */ |
miruga27 | 0:7fb6877b5d7c | 138 | SDL_WINDOWEVENT_SHOWN, /**< Window has been shown */ |
miruga27 | 0:7fb6877b5d7c | 139 | SDL_WINDOWEVENT_HIDDEN, /**< Window has been hidden */ |
miruga27 | 0:7fb6877b5d7c | 140 | SDL_WINDOWEVENT_EXPOSED, /**< Window has been exposed and should be |
miruga27 | 0:7fb6877b5d7c | 141 | redrawn */ |
miruga27 | 0:7fb6877b5d7c | 142 | SDL_WINDOWEVENT_MOVED, /**< Window has been moved to data1, data2 |
miruga27 | 0:7fb6877b5d7c | 143 | */ |
miruga27 | 0:7fb6877b5d7c | 144 | SDL_WINDOWEVENT_RESIZED, /**< Window has been resized to data1xdata2 */ |
miruga27 | 0:7fb6877b5d7c | 145 | SDL_WINDOWEVENT_SIZE_CHANGED, /**< The window size has changed, either as a result of an API call or through the system or user changing the window size. */ |
miruga27 | 0:7fb6877b5d7c | 146 | SDL_WINDOWEVENT_MINIMIZED, /**< Window has been minimized */ |
miruga27 | 0:7fb6877b5d7c | 147 | SDL_WINDOWEVENT_MAXIMIZED, /**< Window has been maximized */ |
miruga27 | 0:7fb6877b5d7c | 148 | SDL_WINDOWEVENT_RESTORED, /**< Window has been restored to normal size |
miruga27 | 0:7fb6877b5d7c | 149 | and position */ |
miruga27 | 0:7fb6877b5d7c | 150 | SDL_WINDOWEVENT_ENTER, /**< Window has gained mouse focus */ |
miruga27 | 0:7fb6877b5d7c | 151 | SDL_WINDOWEVENT_LEAVE, /**< Window has lost mouse focus */ |
miruga27 | 0:7fb6877b5d7c | 152 | SDL_WINDOWEVENT_FOCUS_GAINED, /**< Window has gained keyboard focus */ |
miruga27 | 0:7fb6877b5d7c | 153 | SDL_WINDOWEVENT_FOCUS_LOST, /**< Window has lost keyboard focus */ |
miruga27 | 0:7fb6877b5d7c | 154 | SDL_WINDOWEVENT_CLOSE /**< The window manager requests that the |
miruga27 | 0:7fb6877b5d7c | 155 | window be closed */ |
miruga27 | 0:7fb6877b5d7c | 156 | } SDL_WindowEventID; |
miruga27 | 0:7fb6877b5d7c | 157 | |
miruga27 | 0:7fb6877b5d7c | 158 | /** |
miruga27 | 0:7fb6877b5d7c | 159 | * \brief An opaque handle to an OpenGL context. |
miruga27 | 0:7fb6877b5d7c | 160 | */ |
miruga27 | 0:7fb6877b5d7c | 161 | typedef void *SDL_GLContext; |
miruga27 | 0:7fb6877b5d7c | 162 | |
miruga27 | 0:7fb6877b5d7c | 163 | /** |
miruga27 | 0:7fb6877b5d7c | 164 | * \brief OpenGL configuration attributes |
miruga27 | 0:7fb6877b5d7c | 165 | */ |
miruga27 | 0:7fb6877b5d7c | 166 | typedef enum |
miruga27 | 0:7fb6877b5d7c | 167 | { |
miruga27 | 0:7fb6877b5d7c | 168 | SDL_GL_RED_SIZE, |
miruga27 | 0:7fb6877b5d7c | 169 | SDL_GL_GREEN_SIZE, |
miruga27 | 0:7fb6877b5d7c | 170 | SDL_GL_BLUE_SIZE, |
miruga27 | 0:7fb6877b5d7c | 171 | SDL_GL_ALPHA_SIZE, |
miruga27 | 0:7fb6877b5d7c | 172 | SDL_GL_BUFFER_SIZE, |
miruga27 | 0:7fb6877b5d7c | 173 | SDL_GL_DOUBLEBUFFER, |
miruga27 | 0:7fb6877b5d7c | 174 | SDL_GL_DEPTH_SIZE, |
miruga27 | 0:7fb6877b5d7c | 175 | SDL_GL_STENCIL_SIZE, |
miruga27 | 0:7fb6877b5d7c | 176 | SDL_GL_ACCUM_RED_SIZE, |
miruga27 | 0:7fb6877b5d7c | 177 | SDL_GL_ACCUM_GREEN_SIZE, |
miruga27 | 0:7fb6877b5d7c | 178 | SDL_GL_ACCUM_BLUE_SIZE, |
miruga27 | 0:7fb6877b5d7c | 179 | SDL_GL_ACCUM_ALPHA_SIZE, |
miruga27 | 0:7fb6877b5d7c | 180 | SDL_GL_STEREO, |
miruga27 | 0:7fb6877b5d7c | 181 | SDL_GL_MULTISAMPLEBUFFERS, |
miruga27 | 0:7fb6877b5d7c | 182 | SDL_GL_MULTISAMPLESAMPLES, |
miruga27 | 0:7fb6877b5d7c | 183 | SDL_GL_ACCELERATED_VISUAL, |
miruga27 | 0:7fb6877b5d7c | 184 | SDL_GL_RETAINED_BACKING, |
miruga27 | 0:7fb6877b5d7c | 185 | SDL_GL_CONTEXT_MAJOR_VERSION, |
miruga27 | 0:7fb6877b5d7c | 186 | SDL_GL_CONTEXT_MINOR_VERSION, |
miruga27 | 0:7fb6877b5d7c | 187 | SDL_GL_CONTEXT_EGL, |
miruga27 | 0:7fb6877b5d7c | 188 | SDL_GL_CONTEXT_FLAGS, |
miruga27 | 0:7fb6877b5d7c | 189 | SDL_GL_CONTEXT_PROFILE_MASK, |
miruga27 | 0:7fb6877b5d7c | 190 | SDL_GL_SHARE_WITH_CURRENT_CONTEXT, |
miruga27 | 0:7fb6877b5d7c | 191 | SDL_GL_FRAMEBUFFER_SRGB_CAPABLE |
miruga27 | 0:7fb6877b5d7c | 192 | } SDL_GLattr; |
miruga27 | 0:7fb6877b5d7c | 193 | |
miruga27 | 0:7fb6877b5d7c | 194 | typedef enum |
miruga27 | 0:7fb6877b5d7c | 195 | { |
miruga27 | 0:7fb6877b5d7c | 196 | SDL_GL_CONTEXT_PROFILE_CORE = 0x0001, |
miruga27 | 0:7fb6877b5d7c | 197 | SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002, |
miruga27 | 0:7fb6877b5d7c | 198 | SDL_GL_CONTEXT_PROFILE_ES = 0x0004 /* GLX_CONTEXT_ES2_PROFILE_BIT_EXT */ |
miruga27 | 0:7fb6877b5d7c | 199 | } SDL_GLprofile; |
miruga27 | 0:7fb6877b5d7c | 200 | |
miruga27 | 0:7fb6877b5d7c | 201 | typedef enum |
miruga27 | 0:7fb6877b5d7c | 202 | { |
miruga27 | 0:7fb6877b5d7c | 203 | SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001, |
miruga27 | 0:7fb6877b5d7c | 204 | SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002, |
miruga27 | 0:7fb6877b5d7c | 205 | SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004, |
miruga27 | 0:7fb6877b5d7c | 206 | SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008 |
miruga27 | 0:7fb6877b5d7c | 207 | } SDL_GLcontextFlag; |
miruga27 | 0:7fb6877b5d7c | 208 | |
miruga27 | 0:7fb6877b5d7c | 209 | |
miruga27 | 0:7fb6877b5d7c | 210 | /* Function prototypes */ |
miruga27 | 0:7fb6877b5d7c | 211 | |
miruga27 | 0:7fb6877b5d7c | 212 | /** |
miruga27 | 0:7fb6877b5d7c | 213 | * \brief Get the number of video drivers compiled into SDL |
miruga27 | 0:7fb6877b5d7c | 214 | * |
miruga27 | 0:7fb6877b5d7c | 215 | * \sa SDL_GetVideoDriver() |
miruga27 | 0:7fb6877b5d7c | 216 | */ |
miruga27 | 0:7fb6877b5d7c | 217 | extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void); |
miruga27 | 0:7fb6877b5d7c | 218 | |
miruga27 | 0:7fb6877b5d7c | 219 | /** |
miruga27 | 0:7fb6877b5d7c | 220 | * \brief Get the name of a built in video driver. |
miruga27 | 0:7fb6877b5d7c | 221 | * |
miruga27 | 0:7fb6877b5d7c | 222 | * \note The video drivers are presented in the order in which they are |
miruga27 | 0:7fb6877b5d7c | 223 | * normally checked during initialization. |
miruga27 | 0:7fb6877b5d7c | 224 | * |
miruga27 | 0:7fb6877b5d7c | 225 | * \sa SDL_GetNumVideoDrivers() |
miruga27 | 0:7fb6877b5d7c | 226 | */ |
miruga27 | 0:7fb6877b5d7c | 227 | extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index); |
miruga27 | 0:7fb6877b5d7c | 228 | |
miruga27 | 0:7fb6877b5d7c | 229 | /** |
miruga27 | 0:7fb6877b5d7c | 230 | * \brief Initialize the video subsystem, optionally specifying a video driver. |
miruga27 | 0:7fb6877b5d7c | 231 | * |
miruga27 | 0:7fb6877b5d7c | 232 | * \param driver_name Initialize a specific driver by name, or NULL for the |
miruga27 | 0:7fb6877b5d7c | 233 | * default video driver. |
miruga27 | 0:7fb6877b5d7c | 234 | * |
miruga27 | 0:7fb6877b5d7c | 235 | * \return 0 on success, -1 on error |
miruga27 | 0:7fb6877b5d7c | 236 | * |
miruga27 | 0:7fb6877b5d7c | 237 | * This function initializes the video subsystem; setting up a connection |
miruga27 | 0:7fb6877b5d7c | 238 | * to the window manager, etc, and determines the available display modes |
miruga27 | 0:7fb6877b5d7c | 239 | * and pixel formats, but does not initialize a window or graphics mode. |
miruga27 | 0:7fb6877b5d7c | 240 | * |
miruga27 | 0:7fb6877b5d7c | 241 | * \sa SDL_VideoQuit() |
miruga27 | 0:7fb6877b5d7c | 242 | */ |
miruga27 | 0:7fb6877b5d7c | 243 | extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name); |
miruga27 | 0:7fb6877b5d7c | 244 | |
miruga27 | 0:7fb6877b5d7c | 245 | /** |
miruga27 | 0:7fb6877b5d7c | 246 | * \brief Shuts down the video subsystem. |
miruga27 | 0:7fb6877b5d7c | 247 | * |
miruga27 | 0:7fb6877b5d7c | 248 | * This function closes all windows, and restores the original video mode. |
miruga27 | 0:7fb6877b5d7c | 249 | * |
miruga27 | 0:7fb6877b5d7c | 250 | * \sa SDL_VideoInit() |
miruga27 | 0:7fb6877b5d7c | 251 | */ |
miruga27 | 0:7fb6877b5d7c | 252 | extern DECLSPEC void SDLCALL SDL_VideoQuit(void); |
miruga27 | 0:7fb6877b5d7c | 253 | |
miruga27 | 0:7fb6877b5d7c | 254 | /** |
miruga27 | 0:7fb6877b5d7c | 255 | * \brief Returns the name of the currently initialized video driver. |
miruga27 | 0:7fb6877b5d7c | 256 | * |
miruga27 | 0:7fb6877b5d7c | 257 | * \return The name of the current video driver or NULL if no driver |
miruga27 | 0:7fb6877b5d7c | 258 | * has been initialized |
miruga27 | 0:7fb6877b5d7c | 259 | * |
miruga27 | 0:7fb6877b5d7c | 260 | * \sa SDL_GetNumVideoDrivers() |
miruga27 | 0:7fb6877b5d7c | 261 | * \sa SDL_GetVideoDriver() |
miruga27 | 0:7fb6877b5d7c | 262 | */ |
miruga27 | 0:7fb6877b5d7c | 263 | extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void); |
miruga27 | 0:7fb6877b5d7c | 264 | |
miruga27 | 0:7fb6877b5d7c | 265 | /** |
miruga27 | 0:7fb6877b5d7c | 266 | * \brief Returns the number of available video displays. |
miruga27 | 0:7fb6877b5d7c | 267 | * |
miruga27 | 0:7fb6877b5d7c | 268 | * \sa SDL_GetDisplayBounds() |
miruga27 | 0:7fb6877b5d7c | 269 | */ |
miruga27 | 0:7fb6877b5d7c | 270 | extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void); |
miruga27 | 0:7fb6877b5d7c | 271 | |
miruga27 | 0:7fb6877b5d7c | 272 | /** |
miruga27 | 0:7fb6877b5d7c | 273 | * \brief Get the name of a display in UTF-8 encoding |
miruga27 | 0:7fb6877b5d7c | 274 | * |
miruga27 | 0:7fb6877b5d7c | 275 | * \return The name of a display, or NULL for an invalid display index. |
miruga27 | 0:7fb6877b5d7c | 276 | * |
miruga27 | 0:7fb6877b5d7c | 277 | * \sa SDL_GetNumVideoDisplays() |
miruga27 | 0:7fb6877b5d7c | 278 | */ |
miruga27 | 0:7fb6877b5d7c | 279 | extern DECLSPEC const char * SDLCALL SDL_GetDisplayName(int displayIndex); |
miruga27 | 0:7fb6877b5d7c | 280 | |
miruga27 | 0:7fb6877b5d7c | 281 | /** |
miruga27 | 0:7fb6877b5d7c | 282 | * \brief Get the desktop area represented by a display, with the primary |
miruga27 | 0:7fb6877b5d7c | 283 | * display located at 0,0 |
miruga27 | 0:7fb6877b5d7c | 284 | * |
miruga27 | 0:7fb6877b5d7c | 285 | * \return 0 on success, or -1 if the index is out of range. |
miruga27 | 0:7fb6877b5d7c | 286 | * |
miruga27 | 0:7fb6877b5d7c | 287 | * \sa SDL_GetNumVideoDisplays() |
miruga27 | 0:7fb6877b5d7c | 288 | */ |
miruga27 | 0:7fb6877b5d7c | 289 | extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect); |
miruga27 | 0:7fb6877b5d7c | 290 | |
miruga27 | 0:7fb6877b5d7c | 291 | /** |
miruga27 | 0:7fb6877b5d7c | 292 | * \brief Returns the number of available display modes. |
miruga27 | 0:7fb6877b5d7c | 293 | * |
miruga27 | 0:7fb6877b5d7c | 294 | * \sa SDL_GetDisplayMode() |
miruga27 | 0:7fb6877b5d7c | 295 | */ |
miruga27 | 0:7fb6877b5d7c | 296 | extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(int displayIndex); |
miruga27 | 0:7fb6877b5d7c | 297 | |
miruga27 | 0:7fb6877b5d7c | 298 | /** |
miruga27 | 0:7fb6877b5d7c | 299 | * \brief Fill in information about a specific display mode. |
miruga27 | 0:7fb6877b5d7c | 300 | * |
miruga27 | 0:7fb6877b5d7c | 301 | * \note The display modes are sorted in this priority: |
miruga27 | 0:7fb6877b5d7c | 302 | * \li bits per pixel -> more colors to fewer colors |
miruga27 | 0:7fb6877b5d7c | 303 | * \li width -> largest to smallest |
miruga27 | 0:7fb6877b5d7c | 304 | * \li height -> largest to smallest |
miruga27 | 0:7fb6877b5d7c | 305 | * \li refresh rate -> highest to lowest |
miruga27 | 0:7fb6877b5d7c | 306 | * |
miruga27 | 0:7fb6877b5d7c | 307 | * \sa SDL_GetNumDisplayModes() |
miruga27 | 0:7fb6877b5d7c | 308 | */ |
miruga27 | 0:7fb6877b5d7c | 309 | extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int displayIndex, int modeIndex, |
miruga27 | 0:7fb6877b5d7c | 310 | SDL_DisplayMode * mode); |
miruga27 | 0:7fb6877b5d7c | 311 | |
miruga27 | 0:7fb6877b5d7c | 312 | /** |
miruga27 | 0:7fb6877b5d7c | 313 | * \brief Fill in information about the desktop display mode. |
miruga27 | 0:7fb6877b5d7c | 314 | */ |
miruga27 | 0:7fb6877b5d7c | 315 | extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode); |
miruga27 | 0:7fb6877b5d7c | 316 | |
miruga27 | 0:7fb6877b5d7c | 317 | /** |
miruga27 | 0:7fb6877b5d7c | 318 | * \brief Fill in information about the current display mode. |
miruga27 | 0:7fb6877b5d7c | 319 | */ |
miruga27 | 0:7fb6877b5d7c | 320 | extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode); |
miruga27 | 0:7fb6877b5d7c | 321 | |
miruga27 | 0:7fb6877b5d7c | 322 | |
miruga27 | 0:7fb6877b5d7c | 323 | /** |
miruga27 | 0:7fb6877b5d7c | 324 | * \brief Get the closest match to the requested display mode. |
miruga27 | 0:7fb6877b5d7c | 325 | * |
miruga27 | 0:7fb6877b5d7c | 326 | * \param displayIndex The index of display from which mode should be queried. |
miruga27 | 0:7fb6877b5d7c | 327 | * \param mode The desired display mode |
miruga27 | 0:7fb6877b5d7c | 328 | * \param closest A pointer to a display mode to be filled in with the closest |
miruga27 | 0:7fb6877b5d7c | 329 | * match of the available display modes. |
miruga27 | 0:7fb6877b5d7c | 330 | * |
miruga27 | 0:7fb6877b5d7c | 331 | * \return The passed in value \c closest, or NULL if no matching video mode |
miruga27 | 0:7fb6877b5d7c | 332 | * was available. |
miruga27 | 0:7fb6877b5d7c | 333 | * |
miruga27 | 0:7fb6877b5d7c | 334 | * The available display modes are scanned, and \c closest is filled in with the |
miruga27 | 0:7fb6877b5d7c | 335 | * closest mode matching the requested mode and returned. The mode format and |
miruga27 | 0:7fb6877b5d7c | 336 | * refresh_rate default to the desktop mode if they are 0. The modes are |
miruga27 | 0:7fb6877b5d7c | 337 | * scanned with size being first priority, format being second priority, and |
miruga27 | 0:7fb6877b5d7c | 338 | * finally checking the refresh_rate. If all the available modes are too |
miruga27 | 0:7fb6877b5d7c | 339 | * small, then NULL is returned. |
miruga27 | 0:7fb6877b5d7c | 340 | * |
miruga27 | 0:7fb6877b5d7c | 341 | * \sa SDL_GetNumDisplayModes() |
miruga27 | 0:7fb6877b5d7c | 342 | * \sa SDL_GetDisplayMode() |
miruga27 | 0:7fb6877b5d7c | 343 | */ |
miruga27 | 0:7fb6877b5d7c | 344 | extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest); |
miruga27 | 0:7fb6877b5d7c | 345 | |
miruga27 | 0:7fb6877b5d7c | 346 | /** |
miruga27 | 0:7fb6877b5d7c | 347 | * \brief Get the display index associated with a window. |
miruga27 | 0:7fb6877b5d7c | 348 | * |
miruga27 | 0:7fb6877b5d7c | 349 | * \return the display index of the display containing the center of the |
miruga27 | 0:7fb6877b5d7c | 350 | * window, or -1 on error. |
miruga27 | 0:7fb6877b5d7c | 351 | */ |
miruga27 | 0:7fb6877b5d7c | 352 | extern DECLSPEC int SDLCALL SDL_GetWindowDisplayIndex(SDL_Window * window); |
miruga27 | 0:7fb6877b5d7c | 353 | |
miruga27 | 0:7fb6877b5d7c | 354 | /** |
miruga27 | 0:7fb6877b5d7c | 355 | * \brief Set the display mode used when a fullscreen window is visible. |
miruga27 | 0:7fb6877b5d7c | 356 | * |
miruga27 | 0:7fb6877b5d7c | 357 | * By default the window's dimensions and the desktop format and refresh rate |
miruga27 | 0:7fb6877b5d7c | 358 | * are used. |
miruga27 | 0:7fb6877b5d7c | 359 | * |
miruga27 | 0:7fb6877b5d7c | 360 | * \param window The window for which the display mode should be set. |
miruga27 | 0:7fb6877b5d7c | 361 | * \param mode The mode to use, or NULL for the default mode. |
miruga27 | 0:7fb6877b5d7c | 362 | * |
miruga27 | 0:7fb6877b5d7c | 363 | * \return 0 on success, or -1 if setting the display mode failed. |
miruga27 | 0:7fb6877b5d7c | 364 | * |
miruga27 | 0:7fb6877b5d7c | 365 | * \sa SDL_GetWindowDisplayMode() |
miruga27 | 0:7fb6877b5d7c | 366 | * \sa SDL_SetWindowFullscreen() |
miruga27 | 0:7fb6877b5d7c | 367 | */ |
miruga27 | 0:7fb6877b5d7c | 368 | extern DECLSPEC int SDLCALL SDL_SetWindowDisplayMode(SDL_Window * window, |
miruga27 | 0:7fb6877b5d7c | 369 | const SDL_DisplayMode |
miruga27 | 0:7fb6877b5d7c | 370 | * mode); |
miruga27 | 0:7fb6877b5d7c | 371 | |
miruga27 | 0:7fb6877b5d7c | 372 | /** |
miruga27 | 0:7fb6877b5d7c | 373 | * \brief Fill in information about the display mode used when a fullscreen |
miruga27 | 0:7fb6877b5d7c | 374 | * window is visible. |
miruga27 | 0:7fb6877b5d7c | 375 | * |
miruga27 | 0:7fb6877b5d7c | 376 | * \sa SDL_SetWindowDisplayMode() |
miruga27 | 0:7fb6877b5d7c | 377 | * \sa SDL_SetWindowFullscreen() |
miruga27 | 0:7fb6877b5d7c | 378 | */ |
miruga27 | 0:7fb6877b5d7c | 379 | extern DECLSPEC int SDLCALL SDL_GetWindowDisplayMode(SDL_Window * window, |
miruga27 | 0:7fb6877b5d7c | 380 | SDL_DisplayMode * mode); |
miruga27 | 0:7fb6877b5d7c | 381 | |
miruga27 | 0:7fb6877b5d7c | 382 | /** |
miruga27 | 0:7fb6877b5d7c | 383 | * \brief Get the pixel format associated with the window. |
miruga27 | 0:7fb6877b5d7c | 384 | */ |
miruga27 | 0:7fb6877b5d7c | 385 | extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); |
miruga27 | 0:7fb6877b5d7c | 386 | |
miruga27 | 0:7fb6877b5d7c | 387 | /** |
miruga27 | 0:7fb6877b5d7c | 388 | * \brief Create a window with the specified position, dimensions, and flags. |
miruga27 | 0:7fb6877b5d7c | 389 | * |
miruga27 | 0:7fb6877b5d7c | 390 | * \param title The title of the window, in UTF-8 encoding. |
miruga27 | 0:7fb6877b5d7c | 391 | * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or |
miruga27 | 0:7fb6877b5d7c | 392 | * ::SDL_WINDOWPOS_UNDEFINED. |
miruga27 | 0:7fb6877b5d7c | 393 | * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or |
miruga27 | 0:7fb6877b5d7c | 394 | * ::SDL_WINDOWPOS_UNDEFINED. |
miruga27 | 0:7fb6877b5d7c | 395 | * \param w The width of the window. |
miruga27 | 0:7fb6877b5d7c | 396 | * \param h The height of the window. |
miruga27 | 0:7fb6877b5d7c | 397 | * \param flags The flags for the window, a mask of any of the following: |
miruga27 | 0:7fb6877b5d7c | 398 | * ::SDL_WINDOW_FULLSCREEN, ::SDL_WINDOW_OPENGL, |
miruga27 | 0:7fb6877b5d7c | 399 | * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_BORDERLESS, |
miruga27 | 0:7fb6877b5d7c | 400 | * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED, |
miruga27 | 0:7fb6877b5d7c | 401 | * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_INPUT_GRABBED, |
miruga27 | 0:7fb6877b5d7c | 402 | * ::SDL_WINDOW_ALLOW_HIGHDPI. |
miruga27 | 0:7fb6877b5d7c | 403 | * |
miruga27 | 0:7fb6877b5d7c | 404 | * \return The id of the window created, or zero if window creation failed. |
miruga27 | 0:7fb6877b5d7c | 405 | * |
miruga27 | 0:7fb6877b5d7c | 406 | * \sa SDL_DestroyWindow() |
miruga27 | 0:7fb6877b5d7c | 407 | */ |
miruga27 | 0:7fb6877b5d7c | 408 | extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title, |
miruga27 | 0:7fb6877b5d7c | 409 | int x, int y, int w, |
miruga27 | 0:7fb6877b5d7c | 410 | int h, Uint32 flags); |
miruga27 | 0:7fb6877b5d7c | 411 | |
miruga27 | 0:7fb6877b5d7c | 412 | /** |
miruga27 | 0:7fb6877b5d7c | 413 | * \brief Create an SDL window from an existing native window. |
miruga27 | 0:7fb6877b5d7c | 414 | * |
miruga27 | 0:7fb6877b5d7c | 415 | * \param data A pointer to driver-dependent window creation data |
miruga27 | 0:7fb6877b5d7c | 416 | * |
miruga27 | 0:7fb6877b5d7c | 417 | * \return The id of the window created, or zero if window creation failed. |
miruga27 | 0:7fb6877b5d7c | 418 | * |
miruga27 | 0:7fb6877b5d7c | 419 | * \sa SDL_DestroyWindow() |
miruga27 | 0:7fb6877b5d7c | 420 | */ |
miruga27 | 0:7fb6877b5d7c | 421 | extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowFrom(const void *data); |
miruga27 | 0:7fb6877b5d7c | 422 | |
miruga27 | 0:7fb6877b5d7c | 423 | /** |
miruga27 | 0:7fb6877b5d7c | 424 | * \brief Get the numeric ID of a window, for logging purposes. |
miruga27 | 0:7fb6877b5d7c | 425 | */ |
miruga27 | 0:7fb6877b5d7c | 426 | extern DECLSPEC Uint32 SDLCALL SDL_GetWindowID(SDL_Window * window); |
miruga27 | 0:7fb6877b5d7c | 427 | |
miruga27 | 0:7fb6877b5d7c | 428 | /** |
miruga27 | 0:7fb6877b5d7c | 429 | * \brief Get a window from a stored ID, or NULL if it doesn't exist. |
miruga27 | 0:7fb6877b5d7c | 430 | */ |
miruga27 | 0:7fb6877b5d7c | 431 | extern DECLSPEC SDL_Window * SDLCALL SDL_GetWindowFromID(Uint32 id); |
miruga27 | 0:7fb6877b5d7c | 432 | |
miruga27 | 0:7fb6877b5d7c | 433 | /** |
miruga27 | 0:7fb6877b5d7c | 434 | * \brief Get the window flags. |
miruga27 | 0:7fb6877b5d7c | 435 | */ |
miruga27 | 0:7fb6877b5d7c | 436 | extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_Window * window); |
miruga27 | 0:7fb6877b5d7c | 437 | |
miruga27 | 0:7fb6877b5d7c | 438 | /** |
miruga27 | 0:7fb6877b5d7c | 439 | * \brief Set the title of a window, in UTF-8 format. |
miruga27 | 0:7fb6877b5d7c | 440 | * |
miruga27 | 0:7fb6877b5d7c | 441 | * \sa SDL_GetWindowTitle() |
miruga27 | 0:7fb6877b5d7c | 442 | */ |
miruga27 | 0:7fb6877b5d7c | 443 | extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_Window * window, |
miruga27 | 0:7fb6877b5d7c | 444 | const char *title); |
miruga27 | 0:7fb6877b5d7c | 445 | |
miruga27 | 0:7fb6877b5d7c | 446 | /** |
miruga27 | 0:7fb6877b5d7c | 447 | * \brief Get the title of a window, in UTF-8 format. |
miruga27 | 0:7fb6877b5d7c | 448 | * |
miruga27 | 0:7fb6877b5d7c | 449 | * \sa SDL_SetWindowTitle() |
miruga27 | 0:7fb6877b5d7c | 450 | */ |
miruga27 | 0:7fb6877b5d7c | 451 | extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window * window); |
miruga27 | 0:7fb6877b5d7c | 452 | |
miruga27 | 0:7fb6877b5d7c | 453 | /** |
miruga27 | 0:7fb6877b5d7c | 454 | * \brief Set the icon for a window. |
miruga27 | 0:7fb6877b5d7c | 455 | * |
miruga27 | 0:7fb6877b5d7c | 456 | * \param window The window for which the icon should be set. |
miruga27 | 0:7fb6877b5d7c | 457 | * \param icon The icon for the window. |
miruga27 | 0:7fb6877b5d7c | 458 | */ |
miruga27 | 0:7fb6877b5d7c | 459 | extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_Window * window, |
miruga27 | 0:7fb6877b5d7c | 460 | SDL_Surface * icon); |
miruga27 | 0:7fb6877b5d7c | 461 | |
miruga27 | 0:7fb6877b5d7c | 462 | /** |
miruga27 | 0:7fb6877b5d7c | 463 | * \brief Associate an arbitrary named pointer with a window. |
miruga27 | 0:7fb6877b5d7c | 464 | * |
miruga27 | 0:7fb6877b5d7c | 465 | * \param window The window to associate with the pointer. |
miruga27 | 0:7fb6877b5d7c | 466 | * \param name The name of the pointer. |
miruga27 | 0:7fb6877b5d7c | 467 | * \param userdata The associated pointer. |
miruga27 | 0:7fb6877b5d7c | 468 | * |
miruga27 | 0:7fb6877b5d7c | 469 | * \return The previous value associated with 'name' |
miruga27 | 0:7fb6877b5d7c | 470 | * |
miruga27 | 0:7fb6877b5d7c | 471 | * \note The name is case-sensitive. |
miruga27 | 0:7fb6877b5d7c | 472 | * |
miruga27 | 0:7fb6877b5d7c | 473 | * \sa SDL_GetWindowData() |
miruga27 | 0:7fb6877b5d7c | 474 | */ |
miruga27 | 0:7fb6877b5d7c | 475 | extern DECLSPEC void* SDLCALL SDL_SetWindowData(SDL_Window * window, |
miruga27 | 0:7fb6877b5d7c | 476 | const char *name, |
miruga27 | 0:7fb6877b5d7c | 477 | void *userdata); |
miruga27 | 0:7fb6877b5d7c | 478 | |
miruga27 | 0:7fb6877b5d7c | 479 | /** |
miruga27 | 0:7fb6877b5d7c | 480 | * \brief Retrieve the data pointer associated with a window. |
miruga27 | 0:7fb6877b5d7c | 481 | * |
miruga27 | 0:7fb6877b5d7c | 482 | * \param window The window to query. |
miruga27 | 0:7fb6877b5d7c | 483 | * \param name The name of the pointer. |
miruga27 | 0:7fb6877b5d7c | 484 | * |
miruga27 | 0:7fb6877b5d7c | 485 | * \return The value associated with 'name' |
miruga27 | 0:7fb6877b5d7c | 486 | * |
miruga27 | 0:7fb6877b5d7c | 487 | * \sa SDL_SetWindowData() |
miruga27 | 0:7fb6877b5d7c | 488 | */ |
miruga27 | 0:7fb6877b5d7c | 489 | extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window * window, |
miruga27 | 0:7fb6877b5d7c | 490 | const char *name); |
miruga27 | 0:7fb6877b5d7c | 491 | |
miruga27 | 0:7fb6877b5d7c | 492 | /** |
miruga27 | 0:7fb6877b5d7c | 493 | * \brief Set the position of a window. |
miruga27 | 0:7fb6877b5d7c | 494 | * |
miruga27 | 0:7fb6877b5d7c | 495 | * \param window The window to reposition. |
miruga27 | 0:7fb6877b5d7c | 496 | * \param x The x coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or |
miruga27 | 0:7fb6877b5d7c | 497 | ::SDL_WINDOWPOS_UNDEFINED. |
miruga27 | 0:7fb6877b5d7c | 498 | * \param y The y coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or |
miruga27 | 0:7fb6877b5d7c | 499 | ::SDL_WINDOWPOS_UNDEFINED. |
miruga27 | 0:7fb6877b5d7c | 500 | * |
miruga27 | 0:7fb6877b5d7c | 501 | * \note The window coordinate origin is the upper left of the display. |
miruga27 | 0:7fb6877b5d7c | 502 | * |
miruga27 | 0:7fb6877b5d7c | 503 | * \sa SDL_GetWindowPosition() |
miruga27 | 0:7fb6877b5d7c | 504 | */ |
miruga27 | 0:7fb6877b5d7c | 505 | extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_Window * window, |
miruga27 | 0:7fb6877b5d7c | 506 | int x, int y); |
miruga27 | 0:7fb6877b5d7c | 507 | |
miruga27 | 0:7fb6877b5d7c | 508 | /** |
miruga27 | 0:7fb6877b5d7c | 509 | * \brief Get the position of a window. |
miruga27 | 0:7fb6877b5d7c | 510 | * |
miruga27 | 0:7fb6877b5d7c | 511 | * \param window The window to query. |
miruga27 | 0:7fb6877b5d7c | 512 | * \param x Pointer to variable for storing the x position, may be NULL |
miruga27 | 0:7fb6877b5d7c | 513 | * \param y Pointer to variable for storing the y position, may be NULL |
miruga27 | 0:7fb6877b5d7c | 514 | * |
miruga27 | 0:7fb6877b5d7c | 515 | * \sa SDL_SetWindowPosition() |
miruga27 | 0:7fb6877b5d7c | 516 | */ |
miruga27 | 0:7fb6877b5d7c | 517 | extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_Window * window, |
miruga27 | 0:7fb6877b5d7c | 518 | int *x, int *y); |
miruga27 | 0:7fb6877b5d7c | 519 | |
miruga27 | 0:7fb6877b5d7c | 520 | /** |
miruga27 | 0:7fb6877b5d7c | 521 | * \brief Set the size of a window's client area. |
miruga27 | 0:7fb6877b5d7c | 522 | * |
miruga27 | 0:7fb6877b5d7c | 523 | * \param window The window to resize. |
miruga27 | 0:7fb6877b5d7c | 524 | * \param w The width of the window, must be >0 |
miruga27 | 0:7fb6877b5d7c | 525 | * \param h The height of the window, must be >0 |
miruga27 | 0:7fb6877b5d7c | 526 | * |
miruga27 | 0:7fb6877b5d7c | 527 | * \note You can't change the size of a fullscreen window, it automatically |
miruga27 | 0:7fb6877b5d7c | 528 | * matches the size of the display mode. |
miruga27 | 0:7fb6877b5d7c | 529 | * |
miruga27 | 0:7fb6877b5d7c | 530 | * \sa SDL_GetWindowSize() |
miruga27 | 0:7fb6877b5d7c | 531 | */ |
miruga27 | 0:7fb6877b5d7c | 532 | extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_Window * window, int w, |
miruga27 | 0:7fb6877b5d7c | 533 | int h); |
miruga27 | 0:7fb6877b5d7c | 534 | |
miruga27 | 0:7fb6877b5d7c | 535 | /** |
miruga27 | 0:7fb6877b5d7c | 536 | * \brief Get the size of a window's client area. |
miruga27 | 0:7fb6877b5d7c | 537 | * |
miruga27 | 0:7fb6877b5d7c | 538 | * \param window The window to query. |
miruga27 | 0:7fb6877b5d7c | 539 | * \param w Pointer to variable for storing the width, may be NULL |
miruga27 | 0:7fb6877b5d7c | 540 | * \param h Pointer to variable for storing the height, may be NULL |
miruga27 | 0:7fb6877b5d7c | 541 | * |
miruga27 | 0:7fb6877b5d7c | 542 | * \sa SDL_SetWindowSize() |
miruga27 | 0:7fb6877b5d7c | 543 | */ |
miruga27 | 0:7fb6877b5d7c | 544 | extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_Window * window, int *w, |
miruga27 | 0:7fb6877b5d7c | 545 | int *h); |
miruga27 | 0:7fb6877b5d7c | 546 | |
miruga27 | 0:7fb6877b5d7c | 547 | /** |
miruga27 | 0:7fb6877b5d7c | 548 | * \brief Set the minimum size of a window's client area. |
miruga27 | 0:7fb6877b5d7c | 549 | * |
miruga27 | 0:7fb6877b5d7c | 550 | * \param window The window to set a new minimum size. |
miruga27 | 0:7fb6877b5d7c | 551 | * \param min_w The minimum width of the window, must be >0 |
miruga27 | 0:7fb6877b5d7c | 552 | * \param min_h The minimum height of the window, must be >0 |
miruga27 | 0:7fb6877b5d7c | 553 | * |
miruga27 | 0:7fb6877b5d7c | 554 | * \note You can't change the minimum size of a fullscreen window, it |
miruga27 | 0:7fb6877b5d7c | 555 | * automatically matches the size of the display mode. |
miruga27 | 0:7fb6877b5d7c | 556 | * |
miruga27 | 0:7fb6877b5d7c | 557 | * \sa SDL_GetWindowMinimumSize() |
miruga27 | 0:7fb6877b5d7c | 558 | * \sa SDL_SetWindowMaximumSize() |
miruga27 | 0:7fb6877b5d7c | 559 | */ |
miruga27 | 0:7fb6877b5d7c | 560 | extern DECLSPEC void SDLCALL SDL_SetWindowMinimumSize(SDL_Window * window, |
miruga27 | 0:7fb6877b5d7c | 561 | int min_w, int min_h); |
miruga27 | 0:7fb6877b5d7c | 562 | |
miruga27 | 0:7fb6877b5d7c | 563 | /** |
miruga27 | 0:7fb6877b5d7c | 564 | * \brief Get the minimum size of a window's client area. |
miruga27 | 0:7fb6877b5d7c | 565 | * |
miruga27 | 0:7fb6877b5d7c | 566 | * \param window The window to query. |
miruga27 | 0:7fb6877b5d7c | 567 | * \param w Pointer to variable for storing the minimum width, may be NULL |
miruga27 | 0:7fb6877b5d7c | 568 | * \param h Pointer to variable for storing the minimum height, may be NULL |
miruga27 | 0:7fb6877b5d7c | 569 | * |
miruga27 | 0:7fb6877b5d7c | 570 | * \sa SDL_GetWindowMaximumSize() |
miruga27 | 0:7fb6877b5d7c | 571 | * \sa SDL_SetWindowMinimumSize() |
miruga27 | 0:7fb6877b5d7c | 572 | */ |
miruga27 | 0:7fb6877b5d7c | 573 | extern DECLSPEC void SDLCALL SDL_GetWindowMinimumSize(SDL_Window * window, |
miruga27 | 0:7fb6877b5d7c | 574 | int *w, int *h); |
miruga27 | 0:7fb6877b5d7c | 575 | |
miruga27 | 0:7fb6877b5d7c | 576 | /** |
miruga27 | 0:7fb6877b5d7c | 577 | * \brief Set the maximum size of a window's client area. |
miruga27 | 0:7fb6877b5d7c | 578 | * |
miruga27 | 0:7fb6877b5d7c | 579 | * \param window The window to set a new maximum size. |
miruga27 | 0:7fb6877b5d7c | 580 | * \param max_w The maximum width of the window, must be >0 |
miruga27 | 0:7fb6877b5d7c | 581 | * \param max_h The maximum height of the window, must be >0 |
miruga27 | 0:7fb6877b5d7c | 582 | * |
miruga27 | 0:7fb6877b5d7c | 583 | * \note You can't change the maximum size of a fullscreen window, it |
miruga27 | 0:7fb6877b5d7c | 584 | * automatically matches the size of the display mode. |
miruga27 | 0:7fb6877b5d7c | 585 | * |
miruga27 | 0:7fb6877b5d7c | 586 | * \sa SDL_GetWindowMaximumSize() |
miruga27 | 0:7fb6877b5d7c | 587 | * \sa SDL_SetWindowMinimumSize() |
miruga27 | 0:7fb6877b5d7c | 588 | */ |
miruga27 | 0:7fb6877b5d7c | 589 | extern DECLSPEC void SDLCALL SDL_SetWindowMaximumSize(SDL_Window * window, |
miruga27 | 0:7fb6877b5d7c | 590 | int max_w, int max_h); |
miruga27 | 0:7fb6877b5d7c | 591 | |
miruga27 | 0:7fb6877b5d7c | 592 | /** |
miruga27 | 0:7fb6877b5d7c | 593 | * \brief Get the maximum size of a window's client area. |
miruga27 | 0:7fb6877b5d7c | 594 | * |
miruga27 | 0:7fb6877b5d7c | 595 | * \param window The window to query. |
miruga27 | 0:7fb6877b5d7c | 596 | * \param w Pointer to variable for storing the maximum width, may be NULL |
miruga27 | 0:7fb6877b5d7c | 597 | * \param h Pointer to variable for storing the maximum height, may be NULL |
miruga27 | 0:7fb6877b5d7c | 598 | * |
miruga27 | 0:7fb6877b5d7c | 599 | * \sa SDL_GetWindowMinimumSize() |
miruga27 | 0:7fb6877b5d7c | 600 | * \sa SDL_SetWindowMaximumSize() |
miruga27 | 0:7fb6877b5d7c | 601 | */ |
miruga27 | 0:7fb6877b5d7c | 602 | extern DECLSPEC void SDLCALL SDL_GetWindowMaximumSize(SDL_Window * window, |
miruga27 | 0:7fb6877b5d7c | 603 | int *w, int *h); |
miruga27 | 0:7fb6877b5d7c | 604 | |
miruga27 | 0:7fb6877b5d7c | 605 | /** |
miruga27 | 0:7fb6877b5d7c | 606 | * \brief Set the border state of a window. |
miruga27 | 0:7fb6877b5d7c | 607 | * |
miruga27 | 0:7fb6877b5d7c | 608 | * This will add or remove the window's SDL_WINDOW_BORDERLESS flag and |
miruga27 | 0:7fb6877b5d7c | 609 | * add or remove the border from the actual window. This is a no-op if the |
miruga27 | 0:7fb6877b5d7c | 610 | * window's border already matches the requested state. |
miruga27 | 0:7fb6877b5d7c | 611 | * |
miruga27 | 0:7fb6877b5d7c | 612 | * \param window The window of which to change the border state. |
miruga27 | 0:7fb6877b5d7c | 613 | * \param bordered SDL_FALSE to remove border, SDL_TRUE to add border. |
miruga27 | 0:7fb6877b5d7c | 614 | * |
miruga27 | 0:7fb6877b5d7c | 615 | * \note You can't change the border state of a fullscreen window. |
miruga27 | 0:7fb6877b5d7c | 616 | * |
miruga27 | 0:7fb6877b5d7c | 617 | * \sa SDL_GetWindowFlags() |
miruga27 | 0:7fb6877b5d7c | 618 | */ |
miruga27 | 0:7fb6877b5d7c | 619 | extern DECLSPEC void SDLCALL SDL_SetWindowBordered(SDL_Window * window, |
miruga27 | 0:7fb6877b5d7c | 620 | SDL_bool bordered); |
miruga27 | 0:7fb6877b5d7c | 621 | |
miruga27 | 0:7fb6877b5d7c | 622 | /** |
miruga27 | 0:7fb6877b5d7c | 623 | * \brief Show a window. |
miruga27 | 0:7fb6877b5d7c | 624 | * |
miruga27 | 0:7fb6877b5d7c | 625 | * \sa SDL_HideWindow() |
miruga27 | 0:7fb6877b5d7c | 626 | */ |
miruga27 | 0:7fb6877b5d7c | 627 | extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_Window * window); |
miruga27 | 0:7fb6877b5d7c | 628 | |
miruga27 | 0:7fb6877b5d7c | 629 | /** |
miruga27 | 0:7fb6877b5d7c | 630 | * \brief Hide a window. |
miruga27 | 0:7fb6877b5d7c | 631 | * |
miruga27 | 0:7fb6877b5d7c | 632 | * \sa SDL_ShowWindow() |
miruga27 | 0:7fb6877b5d7c | 633 | */ |
miruga27 | 0:7fb6877b5d7c | 634 | extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_Window * window); |
miruga27 | 0:7fb6877b5d7c | 635 | |
miruga27 | 0:7fb6877b5d7c | 636 | /** |
miruga27 | 0:7fb6877b5d7c | 637 | * \brief Raise a window above other windows and set the input focus. |
miruga27 | 0:7fb6877b5d7c | 638 | */ |
miruga27 | 0:7fb6877b5d7c | 639 | extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_Window * window); |
miruga27 | 0:7fb6877b5d7c | 640 | |
miruga27 | 0:7fb6877b5d7c | 641 | /** |
miruga27 | 0:7fb6877b5d7c | 642 | * \brief Make a window as large as possible. |
miruga27 | 0:7fb6877b5d7c | 643 | * |
miruga27 | 0:7fb6877b5d7c | 644 | * \sa SDL_RestoreWindow() |
miruga27 | 0:7fb6877b5d7c | 645 | */ |
miruga27 | 0:7fb6877b5d7c | 646 | extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_Window * window); |
miruga27 | 0:7fb6877b5d7c | 647 | |
miruga27 | 0:7fb6877b5d7c | 648 | /** |
miruga27 | 0:7fb6877b5d7c | 649 | * \brief Minimize a window to an iconic representation. |
miruga27 | 0:7fb6877b5d7c | 650 | * |
miruga27 | 0:7fb6877b5d7c | 651 | * \sa SDL_RestoreWindow() |
miruga27 | 0:7fb6877b5d7c | 652 | */ |
miruga27 | 0:7fb6877b5d7c | 653 | extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_Window * window); |
miruga27 | 0:7fb6877b5d7c | 654 | |
miruga27 | 0:7fb6877b5d7c | 655 | /** |
miruga27 | 0:7fb6877b5d7c | 656 | * \brief Restore the size and position of a minimized or maximized window. |
miruga27 | 0:7fb6877b5d7c | 657 | * |
miruga27 | 0:7fb6877b5d7c | 658 | * \sa SDL_MaximizeWindow() |
miruga27 | 0:7fb6877b5d7c | 659 | * \sa SDL_MinimizeWindow() |
miruga27 | 0:7fb6877b5d7c | 660 | */ |
miruga27 | 0:7fb6877b5d7c | 661 | extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window * window); |
miruga27 | 0:7fb6877b5d7c | 662 | |
miruga27 | 0:7fb6877b5d7c | 663 | /** |
miruga27 | 0:7fb6877b5d7c | 664 | * \brief Set a window's fullscreen state. |
miruga27 | 0:7fb6877b5d7c | 665 | * |
miruga27 | 0:7fb6877b5d7c | 666 | * \return 0 on success, or -1 if setting the display mode failed. |
miruga27 | 0:7fb6877b5d7c | 667 | * |
miruga27 | 0:7fb6877b5d7c | 668 | * \sa SDL_SetWindowDisplayMode() |
miruga27 | 0:7fb6877b5d7c | 669 | * \sa SDL_GetWindowDisplayMode() |
miruga27 | 0:7fb6877b5d7c | 670 | */ |
miruga27 | 0:7fb6877b5d7c | 671 | extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window, |
miruga27 | 0:7fb6877b5d7c | 672 | Uint32 flags); |
miruga27 | 0:7fb6877b5d7c | 673 | |
miruga27 | 0:7fb6877b5d7c | 674 | /** |
miruga27 | 0:7fb6877b5d7c | 675 | * \brief Get the SDL surface associated with the window. |
miruga27 | 0:7fb6877b5d7c | 676 | * |
miruga27 | 0:7fb6877b5d7c | 677 | * \return The window's framebuffer surface, or NULL on error. |
miruga27 | 0:7fb6877b5d7c | 678 | * |
miruga27 | 0:7fb6877b5d7c | 679 | * A new surface will be created with the optimal format for the window, |
miruga27 | 0:7fb6877b5d7c | 680 | * if necessary. This surface will be freed when the window is destroyed. |
miruga27 | 0:7fb6877b5d7c | 681 | * |
miruga27 | 0:7fb6877b5d7c | 682 | * \note You may not combine this with 3D or the rendering API on this window. |
miruga27 | 0:7fb6877b5d7c | 683 | * |
miruga27 | 0:7fb6877b5d7c | 684 | * \sa SDL_UpdateWindowSurface() |
miruga27 | 0:7fb6877b5d7c | 685 | * \sa SDL_UpdateWindowSurfaceRects() |
miruga27 | 0:7fb6877b5d7c | 686 | */ |
miruga27 | 0:7fb6877b5d7c | 687 | extern DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window * window); |
miruga27 | 0:7fb6877b5d7c | 688 | |
miruga27 | 0:7fb6877b5d7c | 689 | /** |
miruga27 | 0:7fb6877b5d7c | 690 | * \brief Copy the window surface to the screen. |
miruga27 | 0:7fb6877b5d7c | 691 | * |
miruga27 | 0:7fb6877b5d7c | 692 | * \return 0 on success, or -1 on error. |
miruga27 | 0:7fb6877b5d7c | 693 | * |
miruga27 | 0:7fb6877b5d7c | 694 | * \sa SDL_GetWindowSurface() |
miruga27 | 0:7fb6877b5d7c | 695 | * \sa SDL_UpdateWindowSurfaceRects() |
miruga27 | 0:7fb6877b5d7c | 696 | */ |
miruga27 | 0:7fb6877b5d7c | 697 | extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window); |
miruga27 | 0:7fb6877b5d7c | 698 | |
miruga27 | 0:7fb6877b5d7c | 699 | /** |
miruga27 | 0:7fb6877b5d7c | 700 | * \brief Copy a number of rectangles on the window surface to the screen. |
miruga27 | 0:7fb6877b5d7c | 701 | * |
miruga27 | 0:7fb6877b5d7c | 702 | * \return 0 on success, or -1 on error. |
miruga27 | 0:7fb6877b5d7c | 703 | * |
miruga27 | 0:7fb6877b5d7c | 704 | * \sa SDL_GetWindowSurface() |
miruga27 | 0:7fb6877b5d7c | 705 | * \sa SDL_UpdateWindowSurfaceRect() |
miruga27 | 0:7fb6877b5d7c | 706 | */ |
miruga27 | 0:7fb6877b5d7c | 707 | extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window, |
miruga27 | 0:7fb6877b5d7c | 708 | const SDL_Rect * rects, |
miruga27 | 0:7fb6877b5d7c | 709 | int numrects); |
miruga27 | 0:7fb6877b5d7c | 710 | |
miruga27 | 0:7fb6877b5d7c | 711 | /** |
miruga27 | 0:7fb6877b5d7c | 712 | * \brief Set a window's input grab mode. |
miruga27 | 0:7fb6877b5d7c | 713 | * |
miruga27 | 0:7fb6877b5d7c | 714 | * \param window The window for which the input grab mode should be set. |
miruga27 | 0:7fb6877b5d7c | 715 | * \param grabbed This is SDL_TRUE to grab input, and SDL_FALSE to release input. |
miruga27 | 0:7fb6877b5d7c | 716 | * |
miruga27 | 0:7fb6877b5d7c | 717 | * \sa SDL_GetWindowGrab() |
miruga27 | 0:7fb6877b5d7c | 718 | */ |
miruga27 | 0:7fb6877b5d7c | 719 | extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window * window, |
miruga27 | 0:7fb6877b5d7c | 720 | SDL_bool grabbed); |
miruga27 | 0:7fb6877b5d7c | 721 | |
miruga27 | 0:7fb6877b5d7c | 722 | /** |
miruga27 | 0:7fb6877b5d7c | 723 | * \brief Get a window's input grab mode. |
miruga27 | 0:7fb6877b5d7c | 724 | * |
miruga27 | 0:7fb6877b5d7c | 725 | * \return This returns SDL_TRUE if input is grabbed, and SDL_FALSE otherwise. |
miruga27 | 0:7fb6877b5d7c | 726 | * |
miruga27 | 0:7fb6877b5d7c | 727 | * \sa SDL_SetWindowGrab() |
miruga27 | 0:7fb6877b5d7c | 728 | */ |
miruga27 | 0:7fb6877b5d7c | 729 | extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowGrab(SDL_Window * window); |
miruga27 | 0:7fb6877b5d7c | 730 | |
miruga27 | 0:7fb6877b5d7c | 731 | /** |
miruga27 | 0:7fb6877b5d7c | 732 | * \brief Set the brightness (gamma correction) for a window. |
miruga27 | 0:7fb6877b5d7c | 733 | * |
miruga27 | 0:7fb6877b5d7c | 734 | * \return 0 on success, or -1 if setting the brightness isn't supported. |
miruga27 | 0:7fb6877b5d7c | 735 | * |
miruga27 | 0:7fb6877b5d7c | 736 | * \sa SDL_GetWindowBrightness() |
miruga27 | 0:7fb6877b5d7c | 737 | * \sa SDL_SetWindowGammaRamp() |
miruga27 | 0:7fb6877b5d7c | 738 | */ |
miruga27 | 0:7fb6877b5d7c | 739 | extern DECLSPEC int SDLCALL SDL_SetWindowBrightness(SDL_Window * window, float brightness); |
miruga27 | 0:7fb6877b5d7c | 740 | |
miruga27 | 0:7fb6877b5d7c | 741 | /** |
miruga27 | 0:7fb6877b5d7c | 742 | * \brief Get the brightness (gamma correction) for a window. |
miruga27 | 0:7fb6877b5d7c | 743 | * |
miruga27 | 0:7fb6877b5d7c | 744 | * \return The last brightness value passed to SDL_SetWindowBrightness() |
miruga27 | 0:7fb6877b5d7c | 745 | * |
miruga27 | 0:7fb6877b5d7c | 746 | * \sa SDL_SetWindowBrightness() |
miruga27 | 0:7fb6877b5d7c | 747 | */ |
miruga27 | 0:7fb6877b5d7c | 748 | extern DECLSPEC float SDLCALL SDL_GetWindowBrightness(SDL_Window * window); |
miruga27 | 0:7fb6877b5d7c | 749 | |
miruga27 | 0:7fb6877b5d7c | 750 | /** |
miruga27 | 0:7fb6877b5d7c | 751 | * \brief Set the gamma ramp for a window. |
miruga27 | 0:7fb6877b5d7c | 752 | * |
miruga27 | 0:7fb6877b5d7c | 753 | * \param window The window for which the gamma ramp should be set. |
miruga27 | 0:7fb6877b5d7c | 754 | * \param red The translation table for the red channel, or NULL. |
miruga27 | 0:7fb6877b5d7c | 755 | * \param green The translation table for the green channel, or NULL. |
miruga27 | 0:7fb6877b5d7c | 756 | * \param blue The translation table for the blue channel, or NULL. |
miruga27 | 0:7fb6877b5d7c | 757 | * |
miruga27 | 0:7fb6877b5d7c | 758 | * \return 0 on success, or -1 if gamma ramps are unsupported. |
miruga27 | 0:7fb6877b5d7c | 759 | * |
miruga27 | 0:7fb6877b5d7c | 760 | * Set the gamma translation table for the red, green, and blue channels |
miruga27 | 0:7fb6877b5d7c | 761 | * of the video hardware. Each table is an array of 256 16-bit quantities, |
miruga27 | 0:7fb6877b5d7c | 762 | * representing a mapping between the input and output for that channel. |
miruga27 | 0:7fb6877b5d7c | 763 | * The input is the index into the array, and the output is the 16-bit |
miruga27 | 0:7fb6877b5d7c | 764 | * gamma value at that index, scaled to the output color precision. |
miruga27 | 0:7fb6877b5d7c | 765 | * |
miruga27 | 0:7fb6877b5d7c | 766 | * \sa SDL_GetWindowGammaRamp() |
miruga27 | 0:7fb6877b5d7c | 767 | */ |
miruga27 | 0:7fb6877b5d7c | 768 | extern DECLSPEC int SDLCALL SDL_SetWindowGammaRamp(SDL_Window * window, |
miruga27 | 0:7fb6877b5d7c | 769 | const Uint16 * red, |
miruga27 | 0:7fb6877b5d7c | 770 | const Uint16 * green, |
miruga27 | 0:7fb6877b5d7c | 771 | const Uint16 * blue); |
miruga27 | 0:7fb6877b5d7c | 772 | |
miruga27 | 0:7fb6877b5d7c | 773 | /** |
miruga27 | 0:7fb6877b5d7c | 774 | * \brief Get the gamma ramp for a window. |
miruga27 | 0:7fb6877b5d7c | 775 | * |
miruga27 | 0:7fb6877b5d7c | 776 | * \param window The window from which the gamma ramp should be queried. |
miruga27 | 0:7fb6877b5d7c | 777 | * \param red A pointer to a 256 element array of 16-bit quantities to hold |
miruga27 | 0:7fb6877b5d7c | 778 | * the translation table for the red channel, or NULL. |
miruga27 | 0:7fb6877b5d7c | 779 | * \param green A pointer to a 256 element array of 16-bit quantities to hold |
miruga27 | 0:7fb6877b5d7c | 780 | * the translation table for the green channel, or NULL. |
miruga27 | 0:7fb6877b5d7c | 781 | * \param blue A pointer to a 256 element array of 16-bit quantities to hold |
miruga27 | 0:7fb6877b5d7c | 782 | * the translation table for the blue channel, or NULL. |
miruga27 | 0:7fb6877b5d7c | 783 | * |
miruga27 | 0:7fb6877b5d7c | 784 | * \return 0 on success, or -1 if gamma ramps are unsupported. |
miruga27 | 0:7fb6877b5d7c | 785 | * |
miruga27 | 0:7fb6877b5d7c | 786 | * \sa SDL_SetWindowGammaRamp() |
miruga27 | 0:7fb6877b5d7c | 787 | */ |
miruga27 | 0:7fb6877b5d7c | 788 | extern DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window * window, |
miruga27 | 0:7fb6877b5d7c | 789 | Uint16 * red, |
miruga27 | 0:7fb6877b5d7c | 790 | Uint16 * green, |
miruga27 | 0:7fb6877b5d7c | 791 | Uint16 * blue); |
miruga27 | 0:7fb6877b5d7c | 792 | |
miruga27 | 0:7fb6877b5d7c | 793 | /** |
miruga27 | 0:7fb6877b5d7c | 794 | * \brief Destroy a window. |
miruga27 | 0:7fb6877b5d7c | 795 | */ |
miruga27 | 0:7fb6877b5d7c | 796 | extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window * window); |
miruga27 | 0:7fb6877b5d7c | 797 | |
miruga27 | 0:7fb6877b5d7c | 798 | |
miruga27 | 0:7fb6877b5d7c | 799 | /** |
miruga27 | 0:7fb6877b5d7c | 800 | * \brief Returns whether the screensaver is currently enabled (default on). |
miruga27 | 0:7fb6877b5d7c | 801 | * |
miruga27 | 0:7fb6877b5d7c | 802 | * \sa SDL_EnableScreenSaver() |
miruga27 | 0:7fb6877b5d7c | 803 | * \sa SDL_DisableScreenSaver() |
miruga27 | 0:7fb6877b5d7c | 804 | */ |
miruga27 | 0:7fb6877b5d7c | 805 | extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void); |
miruga27 | 0:7fb6877b5d7c | 806 | |
miruga27 | 0:7fb6877b5d7c | 807 | /** |
miruga27 | 0:7fb6877b5d7c | 808 | * \brief Allow the screen to be blanked by a screensaver |
miruga27 | 0:7fb6877b5d7c | 809 | * |
miruga27 | 0:7fb6877b5d7c | 810 | * \sa SDL_IsScreenSaverEnabled() |
miruga27 | 0:7fb6877b5d7c | 811 | * \sa SDL_DisableScreenSaver() |
miruga27 | 0:7fb6877b5d7c | 812 | */ |
miruga27 | 0:7fb6877b5d7c | 813 | extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void); |
miruga27 | 0:7fb6877b5d7c | 814 | |
miruga27 | 0:7fb6877b5d7c | 815 | /** |
miruga27 | 0:7fb6877b5d7c | 816 | * \brief Prevent the screen from being blanked by a screensaver |
miruga27 | 0:7fb6877b5d7c | 817 | * |
miruga27 | 0:7fb6877b5d7c | 818 | * \sa SDL_IsScreenSaverEnabled() |
miruga27 | 0:7fb6877b5d7c | 819 | * \sa SDL_EnableScreenSaver() |
miruga27 | 0:7fb6877b5d7c | 820 | */ |
miruga27 | 0:7fb6877b5d7c | 821 | extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void); |
miruga27 | 0:7fb6877b5d7c | 822 | |
miruga27 | 0:7fb6877b5d7c | 823 | |
miruga27 | 0:7fb6877b5d7c | 824 | /** |
miruga27 | 0:7fb6877b5d7c | 825 | * \name OpenGL support functions |
miruga27 | 0:7fb6877b5d7c | 826 | */ |
miruga27 | 0:7fb6877b5d7c | 827 | /* @{ */ |
miruga27 | 0:7fb6877b5d7c | 828 | |
miruga27 | 0:7fb6877b5d7c | 829 | /** |
miruga27 | 0:7fb6877b5d7c | 830 | * \brief Dynamically load an OpenGL library. |
miruga27 | 0:7fb6877b5d7c | 831 | * |
miruga27 | 0:7fb6877b5d7c | 832 | * \param path The platform dependent OpenGL library name, or NULL to open the |
miruga27 | 0:7fb6877b5d7c | 833 | * default OpenGL library. |
miruga27 | 0:7fb6877b5d7c | 834 | * |
miruga27 | 0:7fb6877b5d7c | 835 | * \return 0 on success, or -1 if the library couldn't be loaded. |
miruga27 | 0:7fb6877b5d7c | 836 | * |
miruga27 | 0:7fb6877b5d7c | 837 | * This should be done after initializing the video driver, but before |
miruga27 | 0:7fb6877b5d7c | 838 | * creating any OpenGL windows. If no OpenGL library is loaded, the default |
miruga27 | 0:7fb6877b5d7c | 839 | * library will be loaded upon creation of the first OpenGL window. |
miruga27 | 0:7fb6877b5d7c | 840 | * |
miruga27 | 0:7fb6877b5d7c | 841 | * \note If you do this, you need to retrieve all of the GL functions used in |
miruga27 | 0:7fb6877b5d7c | 842 | * your program from the dynamic library using SDL_GL_GetProcAddress(). |
miruga27 | 0:7fb6877b5d7c | 843 | * |
miruga27 | 0:7fb6877b5d7c | 844 | * \sa SDL_GL_GetProcAddress() |
miruga27 | 0:7fb6877b5d7c | 845 | * \sa SDL_GL_UnloadLibrary() |
miruga27 | 0:7fb6877b5d7c | 846 | */ |
miruga27 | 0:7fb6877b5d7c | 847 | extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); |
miruga27 | 0:7fb6877b5d7c | 848 | |
miruga27 | 0:7fb6877b5d7c | 849 | /** |
miruga27 | 0:7fb6877b5d7c | 850 | * \brief Get the address of an OpenGL function. |
miruga27 | 0:7fb6877b5d7c | 851 | */ |
miruga27 | 0:7fb6877b5d7c | 852 | extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc); |
miruga27 | 0:7fb6877b5d7c | 853 | |
miruga27 | 0:7fb6877b5d7c | 854 | /** |
miruga27 | 0:7fb6877b5d7c | 855 | * \brief Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary(). |
miruga27 | 0:7fb6877b5d7c | 856 | * |
miruga27 | 0:7fb6877b5d7c | 857 | * \sa SDL_GL_LoadLibrary() |
miruga27 | 0:7fb6877b5d7c | 858 | */ |
miruga27 | 0:7fb6877b5d7c | 859 | extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void); |
miruga27 | 0:7fb6877b5d7c | 860 | |
miruga27 | 0:7fb6877b5d7c | 861 | /** |
miruga27 | 0:7fb6877b5d7c | 862 | * \brief Return true if an OpenGL extension is supported for the current |
miruga27 | 0:7fb6877b5d7c | 863 | * context. |
miruga27 | 0:7fb6877b5d7c | 864 | */ |
miruga27 | 0:7fb6877b5d7c | 865 | extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char |
miruga27 | 0:7fb6877b5d7c | 866 | *extension); |
miruga27 | 0:7fb6877b5d7c | 867 | |
miruga27 | 0:7fb6877b5d7c | 868 | /** |
miruga27 | 0:7fb6877b5d7c | 869 | * \brief Reset all previously set OpenGL context attributes to their default values |
miruga27 | 0:7fb6877b5d7c | 870 | */ |
miruga27 | 0:7fb6877b5d7c | 871 | extern DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void); |
miruga27 | 0:7fb6877b5d7c | 872 | |
miruga27 | 0:7fb6877b5d7c | 873 | /** |
miruga27 | 0:7fb6877b5d7c | 874 | * \brief Set an OpenGL window attribute before window creation. |
miruga27 | 0:7fb6877b5d7c | 875 | */ |
miruga27 | 0:7fb6877b5d7c | 876 | extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); |
miruga27 | 0:7fb6877b5d7c | 877 | |
miruga27 | 0:7fb6877b5d7c | 878 | /** |
miruga27 | 0:7fb6877b5d7c | 879 | * \brief Get the actual value for an attribute from the current context. |
miruga27 | 0:7fb6877b5d7c | 880 | */ |
miruga27 | 0:7fb6877b5d7c | 881 | extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value); |
miruga27 | 0:7fb6877b5d7c | 882 | |
miruga27 | 0:7fb6877b5d7c | 883 | /** |
miruga27 | 0:7fb6877b5d7c | 884 | * \brief Create an OpenGL context for use with an OpenGL window, and make it |
miruga27 | 0:7fb6877b5d7c | 885 | * current. |
miruga27 | 0:7fb6877b5d7c | 886 | * |
miruga27 | 0:7fb6877b5d7c | 887 | * \sa SDL_GL_DeleteContext() |
miruga27 | 0:7fb6877b5d7c | 888 | */ |
miruga27 | 0:7fb6877b5d7c | 889 | extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window * |
miruga27 | 0:7fb6877b5d7c | 890 | window); |
miruga27 | 0:7fb6877b5d7c | 891 | |
miruga27 | 0:7fb6877b5d7c | 892 | /** |
miruga27 | 0:7fb6877b5d7c | 893 | * \brief Set up an OpenGL context for rendering into an OpenGL window. |
miruga27 | 0:7fb6877b5d7c | 894 | * |
miruga27 | 0:7fb6877b5d7c | 895 | * \note The context must have been created with a compatible window. |
miruga27 | 0:7fb6877b5d7c | 896 | */ |
miruga27 | 0:7fb6877b5d7c | 897 | extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_Window * window, |
miruga27 | 0:7fb6877b5d7c | 898 | SDL_GLContext context); |
miruga27 | 0:7fb6877b5d7c | 899 | |
miruga27 | 0:7fb6877b5d7c | 900 | /** |
miruga27 | 0:7fb6877b5d7c | 901 | * \brief Get the currently active OpenGL window. |
miruga27 | 0:7fb6877b5d7c | 902 | */ |
miruga27 | 0:7fb6877b5d7c | 903 | extern DECLSPEC SDL_Window* SDLCALL SDL_GL_GetCurrentWindow(void); |
miruga27 | 0:7fb6877b5d7c | 904 | |
miruga27 | 0:7fb6877b5d7c | 905 | /** |
miruga27 | 0:7fb6877b5d7c | 906 | * \brief Get the currently active OpenGL context. |
miruga27 | 0:7fb6877b5d7c | 907 | */ |
miruga27 | 0:7fb6877b5d7c | 908 | extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void); |
miruga27 | 0:7fb6877b5d7c | 909 | |
miruga27 | 0:7fb6877b5d7c | 910 | /** |
miruga27 | 0:7fb6877b5d7c | 911 | * \brief Get the size of a window's underlying drawable (for use with glViewport). |
miruga27 | 0:7fb6877b5d7c | 912 | * |
miruga27 | 0:7fb6877b5d7c | 913 | * \param window Window from which the drawable size should be queried |
miruga27 | 0:7fb6877b5d7c | 914 | * \param w Pointer to variable for storing the width, may be NULL |
miruga27 | 0:7fb6877b5d7c | 915 | * \param h Pointer to variable for storing the height, may be NULL |
miruga27 | 0:7fb6877b5d7c | 916 | * |
miruga27 | 0:7fb6877b5d7c | 917 | * This may differ from SDL_GetWindowSize if we're rendering to a high-DPI |
miruga27 | 0:7fb6877b5d7c | 918 | * drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a |
miruga27 | 0:7fb6877b5d7c | 919 | * platform with high-DPI support (Apple calls this "Retina"), and not disabled |
miruga27 | 0:7fb6877b5d7c | 920 | * by the SDL_HINT_VIDEO_HIGHDPI_DISABLED hint. |
miruga27 | 0:7fb6877b5d7c | 921 | * |
miruga27 | 0:7fb6877b5d7c | 922 | * \sa SDL_GetWindowSize() |
miruga27 | 0:7fb6877b5d7c | 923 | * \sa SDL_CreateWindow() |
miruga27 | 0:7fb6877b5d7c | 924 | */ |
miruga27 | 0:7fb6877b5d7c | 925 | extern DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window * window, int *w, |
miruga27 | 0:7fb6877b5d7c | 926 | int *h); |
miruga27 | 0:7fb6877b5d7c | 927 | |
miruga27 | 0:7fb6877b5d7c | 928 | /** |
miruga27 | 0:7fb6877b5d7c | 929 | * \brief Set the swap interval for the current OpenGL context. |
miruga27 | 0:7fb6877b5d7c | 930 | * |
miruga27 | 0:7fb6877b5d7c | 931 | * \param interval 0 for immediate updates, 1 for updates synchronized with the |
miruga27 | 0:7fb6877b5d7c | 932 | * vertical retrace. If the system supports it, you may |
miruga27 | 0:7fb6877b5d7c | 933 | * specify -1 to allow late swaps to happen immediately |
miruga27 | 0:7fb6877b5d7c | 934 | * instead of waiting for the next retrace. |
miruga27 | 0:7fb6877b5d7c | 935 | * |
miruga27 | 0:7fb6877b5d7c | 936 | * \return 0 on success, or -1 if setting the swap interval is not supported. |
miruga27 | 0:7fb6877b5d7c | 937 | * |
miruga27 | 0:7fb6877b5d7c | 938 | * \sa SDL_GL_GetSwapInterval() |
miruga27 | 0:7fb6877b5d7c | 939 | */ |
miruga27 | 0:7fb6877b5d7c | 940 | extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval); |
miruga27 | 0:7fb6877b5d7c | 941 | |
miruga27 | 0:7fb6877b5d7c | 942 | /** |
miruga27 | 0:7fb6877b5d7c | 943 | * \brief Get the swap interval for the current OpenGL context. |
miruga27 | 0:7fb6877b5d7c | 944 | * |
miruga27 | 0:7fb6877b5d7c | 945 | * \return 0 if there is no vertical retrace synchronization, 1 if the buffer |
miruga27 | 0:7fb6877b5d7c | 946 | * swap is synchronized with the vertical retrace, and -1 if late |
miruga27 | 0:7fb6877b5d7c | 947 | * swaps happen immediately instead of waiting for the next retrace. |
miruga27 | 0:7fb6877b5d7c | 948 | * If the system can't determine the swap interval, or there isn't a |
miruga27 | 0:7fb6877b5d7c | 949 | * valid current context, this will return 0 as a safe default. |
miruga27 | 0:7fb6877b5d7c | 950 | * |
miruga27 | 0:7fb6877b5d7c | 951 | * \sa SDL_GL_SetSwapInterval() |
miruga27 | 0:7fb6877b5d7c | 952 | */ |
miruga27 | 0:7fb6877b5d7c | 953 | extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void); |
miruga27 | 0:7fb6877b5d7c | 954 | |
miruga27 | 0:7fb6877b5d7c | 955 | /** |
miruga27 | 0:7fb6877b5d7c | 956 | * \brief Swap the OpenGL buffers for a window, if double-buffering is |
miruga27 | 0:7fb6877b5d7c | 957 | * supported. |
miruga27 | 0:7fb6877b5d7c | 958 | */ |
miruga27 | 0:7fb6877b5d7c | 959 | extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_Window * window); |
miruga27 | 0:7fb6877b5d7c | 960 | |
miruga27 | 0:7fb6877b5d7c | 961 | /** |
miruga27 | 0:7fb6877b5d7c | 962 | * \brief Delete an OpenGL context. |
miruga27 | 0:7fb6877b5d7c | 963 | * |
miruga27 | 0:7fb6877b5d7c | 964 | * \sa SDL_GL_CreateContext() |
miruga27 | 0:7fb6877b5d7c | 965 | */ |
miruga27 | 0:7fb6877b5d7c | 966 | extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context); |
miruga27 | 0:7fb6877b5d7c | 967 | |
miruga27 | 0:7fb6877b5d7c | 968 | /* @} *//* OpenGL support functions */ |
miruga27 | 0:7fb6877b5d7c | 969 | |
miruga27 | 0:7fb6877b5d7c | 970 | |
miruga27 | 0:7fb6877b5d7c | 971 | /* Ends C function definitions when using C++ */ |
miruga27 | 0:7fb6877b5d7c | 972 | #ifdef __cplusplus |
miruga27 | 0:7fb6877b5d7c | 973 | } |
miruga27 | 0:7fb6877b5d7c | 974 | #endif |
miruga27 | 0:7fb6877b5d7c | 975 | #include "close_code.h" |
miruga27 | 0:7fb6877b5d7c | 976 | |
miruga27 | 0:7fb6877b5d7c | 977 | #endif /* _SDL_video_h */ |
miruga27 | 0:7fb6877b5d7c | 978 | |
miruga27 | 0:7fb6877b5d7c | 979 | /* vi: set ts=4 sw=4 expandtab: */ |