SDL standard library

Dependents:   H261_encoder

Committer:
miruga27
Date:
Wed Sep 07 18:46:53 2016 +0000
Revision:
0:dda4f4550403
7/09/2016;

Who changed what in which revision?

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