include/SDL_video.h
author Ryan C. Gordon <icculus@icculus.org>
Thu, 24 Aug 2017 21:30:53 -0400
changeset 11346 4d2bf1b340cd
parent 11332 e3797888c6f1
child 11365 a9bd2625fa01
permissions -rw-r--r--
opengl: add support for GL_KHR_no_error.

This is completely untested!

Fixes Bugzilla #3721.
slouken@0
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@10737
     3
  Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
slouken@0
     4
slouken@5535
     5
  This software is provided 'as-is', without any express or implied
slouken@5535
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     7
  arising from the use of this software.
slouken@0
     8
slouken@5535
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
    10
  including commercial applications, and to alter it and redistribute it
slouken@5535
    11
  freely, subject to the following restrictions:
slouken@0
    12
slouken@5535
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@5535
    14
     claim that you wrote the original software. If you use this software
slouken@5535
    15
     in a product, an acknowledgment in the product documentation would be
slouken@5535
    16
     appreciated but is not required.
slouken@5535
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@5535
    18
     misrepresented as being the original software.
slouken@5535
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@0
    20
*/
slouken@0
    21
slouken@1895
    22
/**
slouken@3407
    23
 *  \file SDL_video.h
slouken@7191
    24
 *
slouken@3407
    25
 *  Header file for SDL video functions.
slouken@1895
    26
 */
slouken@0
    27
slouken@10638
    28
#ifndef SDL_video_h_
slouken@10638
    29
#define SDL_video_h_
slouken@0
    30
slouken@1356
    31
#include "SDL_stdinc.h"
slouken@1895
    32
#include "SDL_pixels.h"
slouken@2275
    33
#include "SDL_rect.h"
slouken@2275
    34
#include "SDL_surface.h"
slouken@0
    35
slouken@0
    36
#include "begin_code.h"
slouken@0
    37
/* Set up for C function definitions, even when using C++ */
slouken@0
    38
#ifdef __cplusplus
slouken@0
    39
extern "C" {
slouken@0
    40
#endif
slouken@0
    41
slouken@1895
    42
/**
slouken@3407
    43
 *  \brief  The structure that defines a display mode
slouken@7191
    44
 *
slouken@3407
    45
 *  \sa SDL_GetNumDisplayModes()
slouken@3407
    46
 *  \sa SDL_GetDisplayMode()
slouken@3407
    47
 *  \sa SDL_GetDesktopDisplayMode()
slouken@3407
    48
 *  \sa SDL_GetCurrentDisplayMode()
slouken@3407
    49
 *  \sa SDL_GetClosestDisplayMode()
slouken@3500
    50
 *  \sa SDL_SetWindowDisplayMode()
slouken@3500
    51
 *  \sa SDL_GetWindowDisplayMode()
slouken@1895
    52
 */
slouken@1895
    53
typedef struct
slouken@1895
    54
{
slouken@1895
    55
    Uint32 format;              /**< pixel format */
slime73@9995
    56
    int w;                      /**< width, in screen coordinates */
slime73@9995
    57
    int h;                      /**< height, in screen coordinates */
slouken@1895
    58
    int refresh_rate;           /**< refresh rate (or zero for unspecified) */
slouken@1895
    59
    void *driverdata;           /**< driver-specific data, initialize to 0 */
slouken@1895
    60
} SDL_DisplayMode;
slouken@0
    61
slouken@1895
    62
/**
slouken@3407
    63
 *  \brief The type used to identify a window
slouken@7191
    64
 *
slouken@3407
    65
 *  \sa SDL_CreateWindow()
slouken@3407
    66
 *  \sa SDL_CreateWindowFrom()
slouken@3407
    67
 *  \sa SDL_DestroyWindow()
slouken@3407
    68
 *  \sa SDL_GetWindowData()
slouken@3407
    69
 *  \sa SDL_GetWindowFlags()
slouken@3407
    70
 *  \sa SDL_GetWindowGrab()
slouken@3407
    71
 *  \sa SDL_GetWindowPosition()
slouken@3407
    72
 *  \sa SDL_GetWindowSize()
slouken@3407
    73
 *  \sa SDL_GetWindowTitle()
slouken@3407
    74
 *  \sa SDL_HideWindow()
slouken@3407
    75
 *  \sa SDL_MaximizeWindow()
slouken@3407
    76
 *  \sa SDL_MinimizeWindow()
slouken@3407
    77
 *  \sa SDL_RaiseWindow()
slouken@3407
    78
 *  \sa SDL_RestoreWindow()
slouken@3407
    79
 *  \sa SDL_SetWindowData()
slouken@3407
    80
 *  \sa SDL_SetWindowFullscreen()
slouken@3407
    81
 *  \sa SDL_SetWindowGrab()
slouken@3407
    82
 *  \sa SDL_SetWindowIcon()
slouken@3407
    83
 *  \sa SDL_SetWindowPosition()
slouken@3407
    84
 *  \sa SDL_SetWindowSize()
icculus@6429
    85
 *  \sa SDL_SetWindowBordered()
icculus@10385
    86
 *  \sa SDL_SetWindowResizable()
slouken@3407
    87
 *  \sa SDL_SetWindowTitle()
slouken@3407
    88
 *  \sa SDL_ShowWindow()
slouken@1895
    89
 */
slouken@3685
    90
typedef struct SDL_Window SDL_Window;
slouken@0
    91
slouken@1895
    92
/**
slouken@3407
    93
 *  \brief The flags on a window
slouken@7191
    94
 *
slouken@3407
    95
 *  \sa SDL_GetWindowFlags()
slouken@1895
    96
 */
slouken@1895
    97
typedef enum
slouken@1895
    98
{
icculus@10010
    99
    /* !!! FIXME: change this to name = (1<<x). */
slouken@5380
   100
    SDL_WINDOW_FULLSCREEN = 0x00000001,         /**< fullscreen window */
slouken@1895
   101
    SDL_WINDOW_OPENGL = 0x00000002,             /**< window usable with OpenGL context */
slouken@1895
   102
    SDL_WINDOW_SHOWN = 0x00000004,              /**< window is visible */
slouken@5380
   103
    SDL_WINDOW_HIDDEN = 0x00000008,             /**< window is not visible */
slouken@5380
   104
    SDL_WINDOW_BORDERLESS = 0x00000010,         /**< no window decoration */
slouken@5380
   105
    SDL_WINDOW_RESIZABLE = 0x00000020,          /**< window can be resized */
slouken@5380
   106
    SDL_WINDOW_MINIMIZED = 0x00000040,          /**< window is minimized */
slouken@5380
   107
    SDL_WINDOW_MAXIMIZED = 0x00000080,          /**< window is maximized */
slouken@1895
   108
    SDL_WINDOW_INPUT_GRABBED = 0x00000100,      /**< window has grabbed input focus */
slouken@1895
   109
    SDL_WINDOW_INPUT_FOCUS = 0x00000200,        /**< window has input focus */
slouken@3057
   110
    SDL_WINDOW_MOUSE_FOCUS = 0x00000400,        /**< window has mouse focus */
slouken@7191
   111
    SDL_WINDOW_FULLSCREEN_DESKTOP = ( SDL_WINDOW_FULLSCREEN | 0x00001000 ),
urkle@7746
   112
    SDL_WINDOW_FOREIGN = 0x00000800,            /**< window not created by SDL */
icculus@8927
   113
    SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000,      /**< window should be created in high-DPI mode if supported */
icculus@10021
   114
    SDL_WINDOW_MOUSE_CAPTURE = 0x00004000,      /**< window has mouse captured (unrelated to INPUT_GRABBED) */
icculus@10021
   115
    SDL_WINDOW_ALWAYS_ON_TOP = 0x00008000,      /**< window should always be above others */
icculus@10021
   116
    SDL_WINDOW_SKIP_TASKBAR  = 0x00010000,      /**< window should not be added to the taskbar */
icculus@10021
   117
    SDL_WINDOW_UTILITY       = 0x00020000,      /**< window should be treated as a utility window */
icculus@10021
   118
    SDL_WINDOW_TOOLTIP       = 0x00040000,      /**< window should be treated as a tooltip */
slouken@11006
   119
    SDL_WINDOW_POPUP_MENU    = 0x00080000,      /**< window should be treated as a popup menu */
slouken@11006
   120
    SDL_WINDOW_VULKAN        = 0x00100000       /**< window usable for Vulkan surface */
slouken@1895
   121
} SDL_WindowFlags;
slouken@0
   122
slouken@1895
   123
/**
slouken@3407
   124
 *  \brief Used to indicate that you don't care what the window position is.
slouken@1895
   125
 */
slouken@10430
   126
#define SDL_WINDOWPOS_UNDEFINED_MASK    0x1FFF0000u
slouken@5246
   127
#define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X)  (SDL_WINDOWPOS_UNDEFINED_MASK|(X))
slouken@5246
   128
#define SDL_WINDOWPOS_UNDEFINED         SDL_WINDOWPOS_UNDEFINED_DISPLAY(0)
slouken@5246
   129
#define SDL_WINDOWPOS_ISUNDEFINED(X)    \
slouken@5246
   130
            (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK)
slouken@3407
   131
slouken@1895
   132
/**
slouken@3407
   133
 *  \brief Used to indicate that the window position should be centered.
slouken@1895
   134
 */
slouken@10430
   135
#define SDL_WINDOWPOS_CENTERED_MASK    0x2FFF0000u
slouken@5246
   136
#define SDL_WINDOWPOS_CENTERED_DISPLAY(X)  (SDL_WINDOWPOS_CENTERED_MASK|(X))
slouken@5246
   137
#define SDL_WINDOWPOS_CENTERED         SDL_WINDOWPOS_CENTERED_DISPLAY(0)
slouken@5246
   138
#define SDL_WINDOWPOS_ISCENTERED(X)    \
slouken@5246
   139
            (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK)
slouken@1895
   140
slouken@1895
   141
/**
slouken@3407
   142
 *  \brief Event subtype for window events
slouken@1895
   143
 */
slouken@1895
   144
typedef enum
slouken@1895
   145
{
slouken@3407
   146
    SDL_WINDOWEVENT_NONE,           /**< Never used */
slouken@3407
   147
    SDL_WINDOWEVENT_SHOWN,          /**< Window has been shown */
slouken@3407
   148
    SDL_WINDOWEVENT_HIDDEN,         /**< Window has been hidden */
slouken@7191
   149
    SDL_WINDOWEVENT_EXPOSED,        /**< Window has been exposed and should be
slouken@3407
   150
                                         redrawn */
slouken@7191
   151
    SDL_WINDOWEVENT_MOVED,          /**< Window has been moved to data1, data2
slouken@3407
   152
                                     */
slouken@5276
   153
    SDL_WINDOWEVENT_RESIZED,        /**< Window has been resized to data1xdata2 */
slime73@9995
   154
    SDL_WINDOWEVENT_SIZE_CHANGED,   /**< The window size has changed, either as
slime73@9995
   155
                                         a result of an API call or through the
slime73@9995
   156
                                         system or user changing the window size. */
slouken@3407
   157
    SDL_WINDOWEVENT_MINIMIZED,      /**< Window has been minimized */
slouken@3407
   158
    SDL_WINDOWEVENT_MAXIMIZED,      /**< Window has been maximized */
slouken@3407
   159
    SDL_WINDOWEVENT_RESTORED,       /**< Window has been restored to normal size
slouken@3407
   160
                                         and position */
slouken@3691
   161
    SDL_WINDOWEVENT_ENTER,          /**< Window has gained mouse focus */
slouken@3691
   162
    SDL_WINDOWEVENT_LEAVE,          /**< Window has lost mouse focus */
slouken@3691
   163
    SDL_WINDOWEVENT_FOCUS_GAINED,   /**< Window has gained keyboard focus */
slouken@3691
   164
    SDL_WINDOWEVENT_FOCUS_LOST,     /**< Window has lost keyboard focus */
icculus@10028
   165
    SDL_WINDOWEVENT_CLOSE,          /**< The window manager requests that the window be closed */
icculus@10029
   166
    SDL_WINDOWEVENT_TAKE_FOCUS,     /**< Window is being offered a focus (should SetWindowInputFocus() on itself or a subwindow, or ignore) */
icculus@10029
   167
    SDL_WINDOWEVENT_HIT_TEST        /**< Window had a hit test that wasn't SDL_HITTEST_NORMAL. */
slouken@1895
   168
} SDL_WindowEventID;
slouken@1895
   169
slouken@1895
   170
/**
slouken@3407
   171
 *  \brief An opaque handle to an OpenGL context.
slouken@1895
   172
 */
slouken@1895
   173
typedef void *SDL_GLContext;
slouken@1895
   174
slouken@1895
   175
/**
slouken@3407
   176
 *  \brief OpenGL configuration attributes
slouken@0
   177
 */
slouken@1895
   178
typedef enum
slouken@1895
   179
{
slouken@0
   180
    SDL_GL_RED_SIZE,
slouken@0
   181
    SDL_GL_GREEN_SIZE,
slouken@0
   182
    SDL_GL_BLUE_SIZE,
slouken@0
   183
    SDL_GL_ALPHA_SIZE,
slouken@0
   184
    SDL_GL_BUFFER_SIZE,
slouken@0
   185
    SDL_GL_DOUBLEBUFFER,
slouken@0
   186
    SDL_GL_DEPTH_SIZE,
slouken@0
   187
    SDL_GL_STENCIL_SIZE,
slouken@0
   188
    SDL_GL_ACCUM_RED_SIZE,
slouken@0
   189
    SDL_GL_ACCUM_GREEN_SIZE,
slouken@0
   190
    SDL_GL_ACCUM_BLUE_SIZE,
slouken@450
   191
    SDL_GL_ACCUM_ALPHA_SIZE,
slouken@655
   192
    SDL_GL_STEREO,
slouken@656
   193
    SDL_GL_MULTISAMPLEBUFFERS,
slouken@1736
   194
    SDL_GL_MULTISAMPLESAMPLES,
hfutrell@2747
   195
    SDL_GL_ACCELERATED_VISUAL,
slouken@3100
   196
    SDL_GL_RETAINED_BACKING,
slouken@3139
   197
    SDL_GL_CONTEXT_MAJOR_VERSION,
slouken@6296
   198
    SDL_GL_CONTEXT_MINOR_VERSION,
slouken@6370
   199
    SDL_GL_CONTEXT_EGL,
slouken@6296
   200
    SDL_GL_CONTEXT_FLAGS,
slouken@6393
   201
    SDL_GL_CONTEXT_PROFILE_MASK,
icculus@7853
   202
    SDL_GL_SHARE_WITH_CURRENT_CONTEXT,
mdiluzio@9412
   203
    SDL_GL_FRAMEBUFFER_SRGB_CAPABLE,
icculus@11332
   204
    SDL_GL_CONTEXT_RELEASE_BEHAVIOR,
icculus@11346
   205
    SDL_GL_CONTEXT_RESET_NOTIFICATION,
icculus@11346
   206
    SDL_GL_CONTEXT_NO_ERROR
slouken@0
   207
} SDL_GLattr;
slouken@0
   208
slouken@6296
   209
typedef enum
slouken@6296
   210
{
slouken@6296
   211
    SDL_GL_CONTEXT_PROFILE_CORE           = 0x0001,
slouken@6296
   212
    SDL_GL_CONTEXT_PROFILE_COMPATIBILITY  = 0x0002,
philipp@11065
   213
    SDL_GL_CONTEXT_PROFILE_ES             = 0x0004 /**< GLX_CONTEXT_ES2_PROFILE_BIT_EXT */
slouken@6296
   214
} SDL_GLprofile;
slouken@6296
   215
slouken@6296
   216
typedef enum
slouken@6296
   217
{
slouken@6296
   218
    SDL_GL_CONTEXT_DEBUG_FLAG              = 0x0001,
slouken@6296
   219
    SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002,
slouken@6393
   220
    SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG      = 0x0004,
slouken@6393
   221
    SDL_GL_CONTEXT_RESET_ISOLATION_FLAG    = 0x0008
slouken@6296
   222
} SDL_GLcontextFlag;
slouken@6296
   223
mdiluzio@9412
   224
typedef enum
mdiluzio@9412
   225
{
mdiluzio@9412
   226
    SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE   = 0x0000,
mdiluzio@9412
   227
    SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH  = 0x0001
mdiluzio@9412
   228
} SDL_GLcontextReleaseFlag;
mdiluzio@9412
   229
icculus@11332
   230
typedef enum
icculus@11332
   231
{
icculus@11332
   232
    SDL_GL_CONTEXT_RESET_NO_NOTIFICATION = 0x0000,
icculus@11332
   233
    SDL_GL_CONTEXT_RESET_LOSE_CONTEXT    = 0x0001
icculus@11332
   234
} SDL_GLContextResetNotification;
icculus@11332
   235
slouken@0
   236
slouken@0
   237
/* Function prototypes */
slouken@0
   238
slouken@1895
   239
/**
slouken@3407
   240
 *  \brief Get the number of video drivers compiled into SDL
slouken@7191
   241
 *
slouken@3407
   242
 *  \sa SDL_GetVideoDriver()
slouken@0
   243
 */
slouken@1895
   244
extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void);
slouken@1895
   245
slouken@1895
   246
/**
slouken@3407
   247
 *  \brief Get the name of a built in video driver.
slouken@7191
   248
 *
slouken@3407
   249
 *  \note The video drivers are presented in the order in which they are
slouken@3407
   250
 *        normally checked during initialization.
slouken@7191
   251
 *
slouken@3407
   252
 *  \sa SDL_GetNumVideoDrivers()
slouken@1895
   253
 */
slouken@1895
   254
extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index);
slouken@1895
   255
slouken@1895
   256
/**
slouken@3407
   257
 *  \brief Initialize the video subsystem, optionally specifying a video driver.
slouken@7191
   258
 *
slouken@7191
   259
 *  \param driver_name Initialize a specific driver by name, or NULL for the
slouken@3407
   260
 *                     default video driver.
slouken@7191
   261
 *
slouken@3407
   262
 *  \return 0 on success, -1 on error
slouken@7191
   263
 *
slouken@3407
   264
 *  This function initializes the video subsystem; setting up a connection
slouken@3407
   265
 *  to the window manager, etc, and determines the available display modes
slouken@3407
   266
 *  and pixel formats, but does not initialize a window or graphics mode.
slouken@7191
   267
 *
slouken@3407
   268
 *  \sa SDL_VideoQuit()
slouken@1895
   269
 */
slouken@5123
   270
extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name);
slouken@1895
   271
slouken@1895
   272
/**
slouken@3407
   273
 *  \brief Shuts down the video subsystem.
slouken@7191
   274
 *
slouken@3407
   275
 *  This function closes all windows, and restores the original video mode.
slouken@7191
   276
 *
slouken@3407
   277
 *  \sa SDL_VideoInit()
slouken@1895
   278
 */
slouken@337
   279
extern DECLSPEC void SDLCALL SDL_VideoQuit(void);
slouken@0
   280
slouken@1895
   281
/**
slouken@3407
   282
 *  \brief Returns the name of the currently initialized video driver.
slouken@7191
   283
 *
slouken@3407
   284
 *  \return The name of the current video driver or NULL if no driver
slouken@3407
   285
 *          has been initialized
slouken@7191
   286
 *
slouken@3407
   287
 *  \sa SDL_GetNumVideoDrivers()
slouken@3407
   288
 *  \sa SDL_GetVideoDriver()
slouken@0
   289
 */
slouken@1895
   290
extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void);
slouken@0
   291
slouken@1895
   292
/**
slouken@3407
   293
 *  \brief Returns the number of available video displays.
slouken@7191
   294
 *
slouken@3528
   295
 *  \sa SDL_GetDisplayBounds()
slouken@0
   296
 */
slouken@1895
   297
extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void);
slouken@0
   298
slouken@1895
   299
/**
slouken@6787
   300
 *  \brief Get the name of a display in UTF-8 encoding
slouken@7191
   301
 *
slouken@6787
   302
 *  \return The name of a display, or NULL for an invalid display index.
slouken@7191
   303
 *
slouken@6787
   304
 *  \sa SDL_GetNumVideoDisplays()
slouken@6787
   305
 */
slouken@6787
   306
extern DECLSPEC const char * SDLCALL SDL_GetDisplayName(int displayIndex);
slouken@6787
   307
slouken@6787
   308
/**
slouken@3528
   309
 *  \brief Get the desktop area represented by a display, with the primary
slouken@3528
   310
 *         display located at 0,0
slouken@7191
   311
 *
slouken@3528
   312
 *  \return 0 on success, or -1 if the index is out of range.
slouken@7191
   313
 *
slouken@3528
   314
 *  \sa SDL_GetNumVideoDisplays()
slouken@3528
   315
 */
slouken@5244
   316
extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect);
slouken@3528
   317
slouken@3528
   318
/**
alfred@9813
   319
 *  \brief Get the dots/pixels-per-inch for a display
alfred@9813
   320
 *
alfred@9813
   321
 *  \note Diagonal, horizontal and vertical DPI can all be optionally
alfred@9813
   322
 *        returned if the parameter is non-NULL.
alfred@9813
   323
 *
alfred@9813
   324
 *  \return 0 on success, or -1 if no DPI information is available or the index is out of range.
alfred@9813
   325
 *
alfred@9813
   326
 *  \sa SDL_GetNumVideoDisplays()
alfred@9813
   327
 */
alfred@9813
   328
extern DECLSPEC int SDLCALL SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi);
alfred@9813
   329
alfred@9813
   330
/**
icculus@10019
   331
 *  \brief Get the usable desktop area represented by a display, with the
icculus@10019
   332
 *         primary display located at 0,0
icculus@10019
   333
 *
icculus@10019
   334
 *  This is the same area as SDL_GetDisplayBounds() reports, but with portions
icculus@10019
   335
 *  reserved by the system removed. For example, on Mac OS X, this subtracts
icculus@10019
   336
 *  the area occupied by the menu bar and dock.
icculus@10019
   337
 *
icculus@10019
   338
 *  Setting a window to be fullscreen generally bypasses these unusable areas,
icculus@10019
   339
 *  so these are good guidelines for the maximum space available to a
icculus@10019
   340
 *  non-fullscreen window.
icculus@10019
   341
 *
icculus@10019
   342
 *  \return 0 on success, or -1 if the index is out of range.
icculus@10019
   343
 *
icculus@10019
   344
 *  \sa SDL_GetDisplayBounds()
icculus@10019
   345
 *  \sa SDL_GetNumVideoDisplays()
icculus@10019
   346
 */
icculus@10019
   347
extern DECLSPEC int SDLCALL SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect * rect);
icculus@10019
   348
icculus@10019
   349
/**
slouken@5244
   350
 *  \brief Returns the number of available display modes.
slouken@7191
   351
 *
slouken@3407
   352
 *  \sa SDL_GetDisplayMode()
slouken@0
   353
 */
slouken@5244
   354
extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(int displayIndex);
slouken@0
   355
slouken@1895
   356
/**
slouken@3407
   357
 *  \brief Fill in information about a specific display mode.
slouken@7191
   358
 *
slouken@3407
   359
 *  \note The display modes are sorted in this priority:
slouken@3407
   360
 *        \li bits per pixel -> more colors to fewer colors
slouken@3407
   361
 *        \li width -> largest to smallest
slouken@3407
   362
 *        \li height -> largest to smallest
slouken@3407
   363
 *        \li refresh rate -> highest to lowest
slouken@7191
   364
 *
slouken@3407
   365
 *  \sa SDL_GetNumDisplayModes()
slouken@0
   366
 */
slouken@5244
   367
extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int displayIndex, int modeIndex,
slouken@1967
   368
                                               SDL_DisplayMode * mode);
slouken@0
   369
slouken@1895
   370
/**
slouken@5244
   371
 *  \brief Fill in information about the desktop display mode.
slouken@1895
   372
 */
slouken@5244
   373
extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode);
slouken@1895
   374
slouken@1895
   375
/**
slouken@3407
   376
 *  \brief Fill in information about the current display mode.
slouken@1895
   377
 */
slouken@5244
   378
extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode);
slouken@1895
   379
slouken@3400
   380
slouken@1895
   381
/**
slouken@3407
   382
 *  \brief Get the closest match to the requested display mode.
slouken@7191
   383
 *
philipp@7188
   384
 *  \param displayIndex The index of display from which mode should be queried.
slouken@3407
   385
 *  \param mode The desired display mode
slouken@7191
   386
 *  \param closest A pointer to a display mode to be filled in with the closest
slouken@3407
   387
 *                 match of the available display modes.
slouken@7191
   388
 *
slouken@7191
   389
 *  \return The passed in value \c closest, or NULL if no matching video mode
slouken@3407
   390
 *          was available.
slouken@7191
   391
 *
slouken@3407
   392
 *  The available display modes are scanned, and \c closest is filled in with the
slouken@7191
   393
 *  closest mode matching the requested mode and returned.  The mode format and
slouken@7191
   394
 *  refresh_rate default to the desktop mode if they are 0.  The modes are
slouken@7191
   395
 *  scanned with size being first priority, format being second priority, and
slouken@7191
   396
 *  finally checking the refresh_rate.  If all the available modes are too
slouken@3407
   397
 *  small, then NULL is returned.
slouken@7191
   398
 *
slouken@3407
   399
 *  \sa SDL_GetNumDisplayModes()
slouken@3407
   400
 *  \sa SDL_GetDisplayMode()
slouken@1895
   401
 */
slouken@5244
   402
extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest);
slouken@1895
   403
slouken@1895
   404
/**
slouken@5246
   405
 *  \brief Get the display index associated with a window.
slouken@7191
   406
 *
slouken@5246
   407
 *  \return the display index of the display containing the center of the
slouken@5246
   408
 *          window, or -1 on error.
slouken@5246
   409
 */
slouken@6786
   410
extern DECLSPEC int SDLCALL SDL_GetWindowDisplayIndex(SDL_Window * window);
slouken@5246
   411
slouken@5246
   412
/**
slouken@5244
   413
 *  \brief Set the display mode used when a fullscreen window is visible.
slouken@5244
   414
 *
slouken@5244
   415
 *  By default the window's dimensions and the desktop format and refresh rate
slouken@5244
   416
 *  are used.
slouken@7191
   417
 *
philipp@7188
   418
 *  \param window The window for which the display mode should be set.
slouken@3500
   419
 *  \param mode The mode to use, or NULL for the default mode.
slouken@7191
   420
 *
slouken@3407
   421
 *  \return 0 on success, or -1 if setting the display mode failed.
slouken@7191
   422
 *
slouken@3522
   423
 *  \sa SDL_GetWindowDisplayMode()
slouken@3407
   424
 *  \sa SDL_SetWindowFullscreen()
slouken@0
   425
 */
slouken@3685
   426
extern DECLSPEC int SDLCALL SDL_SetWindowDisplayMode(SDL_Window * window,
slouken@3500
   427
                                                     const SDL_DisplayMode
slouken@1895
   428
                                                         * mode);
slouken@0
   429
slouken@1895
   430
/**
slouken@3407
   431
 *  \brief Fill in information about the display mode used when a fullscreen
slouken@5244
   432
 *         window is visible.
slouken@3522
   433
 *
slouken@3522
   434
 *  \sa SDL_SetWindowDisplayMode()
slouken@3522
   435
 *  \sa SDL_SetWindowFullscreen()
slouken@0
   436
 */
slouken@3685
   437
extern DECLSPEC int SDLCALL SDL_GetWindowDisplayMode(SDL_Window * window,
slouken@3500
   438
                                                     SDL_DisplayMode * mode);
slouken@0
   439
slouken@1895
   440
/**
slouken@5154
   441
 *  \brief Get the pixel format associated with the window.
slouken@5154
   442
 */
slouken@5154
   443
extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window);
slouken@5154
   444
slouken@5154
   445
/**
slouken@3407
   446
 *  \brief Create a window with the specified position, dimensions, and flags.
slouken@7191
   447
 *
slouken@3407
   448
 *  \param title The title of the window, in UTF-8 encoding.
slouken@7191
   449
 *  \param x     The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
slouken@3407
   450
 *               ::SDL_WINDOWPOS_UNDEFINED.
slouken@7191
   451
 *  \param y     The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
slouken@3407
   452
 *               ::SDL_WINDOWPOS_UNDEFINED.
slime73@9995
   453
 *  \param w     The width of the window, in screen coordinates.
slime73@9995
   454
 *  \param h     The height of the window, in screen coordinates.
slouken@7191
   455
 *  \param flags The flags for the window, a mask of any of the following:
urkle@7746
   456
 *               ::SDL_WINDOW_FULLSCREEN,    ::SDL_WINDOW_OPENGL,
urkle@7746
   457
 *               ::SDL_WINDOW_HIDDEN,        ::SDL_WINDOW_BORDERLESS,
urkle@7746
   458
 *               ::SDL_WINDOW_RESIZABLE,     ::SDL_WINDOW_MAXIMIZED,
urkle@7746
   459
 *               ::SDL_WINDOW_MINIMIZED,     ::SDL_WINDOW_INPUT_GRABBED,
urkle@7746
   460
 *               ::SDL_WINDOW_ALLOW_HIGHDPI.
slouken@7191
   461
 *
philipp@10168
   462
 *  \return The created window, or NULL if window creation failed.
slouken@7191
   463
 *
slime73@9995
   464
 *  If the window is created with the SDL_WINDOW_ALLOW_HIGHDPI flag, its size
slime73@9995
   465
 *  in pixels may differ from its size in screen coordinates on platforms with
philipp@9996
   466
 *  high-DPI support (e.g. iOS and Mac OS X). Use SDL_GetWindowSize() to query
philipp@9996
   467
 *  the client area's size in screen coordinates, and SDL_GL_GetDrawableSize()
philipp@9996
   468
 *  or SDL_GetRendererOutputSize() to query the drawable size in pixels.
slime73@9995
   469
 *
slouken@3407
   470
 *  \sa SDL_DestroyWindow()
slouken@0
   471
 */
slouken@3685
   472
extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title,
slouken@1895
   473
                                                      int x, int y, int w,
slouken@1895
   474
                                                      int h, Uint32 flags);
slouken@0
   475
slouken@1895
   476
/**
slouken@3493
   477
 *  \brief Create an SDL window from an existing native window.
slouken@7191
   478
 *
slouken@3407
   479
 *  \param data A pointer to driver-dependent window creation data
slouken@7191
   480
 *
philipp@10168
   481
 *  \return The created window, or NULL if window creation failed.
slouken@7191
   482
 *
slouken@3407
   483
 *  \sa SDL_DestroyWindow()
slouken@0
   484
 */
slouken@3685
   485
extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowFrom(const void *data);
slouken@3685
   486
slouken@3685
   487
/**
slouken@4883
   488
 *  \brief Get the numeric ID of a window, for logging purposes.
slouken@3685
   489
 */
slouken@3685
   490
extern DECLSPEC Uint32 SDLCALL SDL_GetWindowID(SDL_Window * window);
slouken@3685
   491
slouken@3685
   492
/**
slouken@3685
   493
 *  \brief Get a window from a stored ID, or NULL if it doesn't exist.
slouken@3685
   494
 */
slouken@3685
   495
extern DECLSPEC SDL_Window * SDLCALL SDL_GetWindowFromID(Uint32 id);
slouken@1895
   496
slouken@1895
   497
/**
slouken@3407
   498
 *  \brief Get the window flags.
slouken@1895
   499
 */
slouken@3685
   500
extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_Window * window);
slouken@1895
   501
slouken@1895
   502
/**
slouken@4883
   503
 *  \brief Set the title of a window, in UTF-8 format.
slouken@7191
   504
 *
slouken@3407
   505
 *  \sa SDL_GetWindowTitle()
slouken@1895
   506
 */
slouken@3685
   507
extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_Window * window,
slouken@1895
   508
                                                const char *title);
slouken@1895
   509
slouken@1895
   510
/**
slouken@4883
   511
 *  \brief Get the title of a window, in UTF-8 format.
slouken@7191
   512
 *
slouken@3407
   513
 *  \sa SDL_SetWindowTitle()
slouken@1895
   514
 */
slouken@3685
   515
extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window * window);
slouken@1895
   516
slouken@1895
   517
/**
slouken@4887
   518
 *  \brief Set the icon for a window.
slouken@7191
   519
 *
philipp@7188
   520
 *  \param window The window for which the icon should be set.
slouken@4887
   521
 *  \param icon The icon for the window.
slouken@1895
   522
 */
slouken@3685
   523
extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_Window * window,
slouken@2990
   524
                                               SDL_Surface * icon);
slouken@1895
   525
slouken@1895
   526
/**
slouken@5165
   527
 *  \brief Associate an arbitrary named pointer with a window.
slouken@7191
   528
 *
slouken@5165
   529
 *  \param window   The window to associate with the pointer.
slouken@5165
   530
 *  \param name     The name of the pointer.
slouken@5165
   531
 *  \param userdata The associated pointer.
slouken@5165
   532
 *
slouken@5165
   533
 *  \return The previous value associated with 'name'
slouken@5165
   534
 *
slouken@5165
   535
 *  \note The name is case-sensitive.
slouken@5165
   536
 *
slouken@3407
   537
 *  \sa SDL_GetWindowData()
slouken@1895
   538
 */
slouken@5165
   539
extern DECLSPEC void* SDLCALL SDL_SetWindowData(SDL_Window * window,
slouken@5165
   540
                                                const char *name,
slouken@5165
   541
                                                void *userdata);
slouken@1895
   542
slouken@1895
   543
/**
slouken@4883
   544
 *  \brief Retrieve the data pointer associated with a window.
slouken@7191
   545
 *
slouken@5165
   546
 *  \param window   The window to query.
slouken@5165
   547
 *  \param name     The name of the pointer.
slouken@5165
   548
 *
slouken@5165
   549
 *  \return The value associated with 'name'
slouken@7191
   550
 *
slouken@3407
   551
 *  \sa SDL_SetWindowData()
slouken@1895
   552
 */
slouken@5165
   553
extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window * window,
slouken@5165
   554
                                                const char *name);
slouken@1895
   555
slouken@1895
   556
/**
slouken@4883
   557
 *  \brief Set the position of a window.
slouken@7191
   558
 *
slouken@5165
   559
 *  \param window   The window to reposition.
slime73@9995
   560
 *  \param x        The x coordinate of the window in screen coordinates, or
slime73@9995
   561
 *                  ::SDL_WINDOWPOS_CENTERED or ::SDL_WINDOWPOS_UNDEFINED.
slime73@9995
   562
 *  \param y        The y coordinate of the window in screen coordinates, or
slime73@9995
   563
 *                  ::SDL_WINDOWPOS_CENTERED or ::SDL_WINDOWPOS_UNDEFINED.
slouken@7191
   564
 *
slouken@3407
   565
 *  \note The window coordinate origin is the upper left of the display.
slouken@7191
   566
 *
slouken@3407
   567
 *  \sa SDL_GetWindowPosition()
slouken@1895
   568
 */
slouken@3685
   569
extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_Window * window,
slouken@1895
   570
                                                   int x, int y);
slouken@1895
   571
slouken@1895
   572
/**
slouken@4883
   573
 *  \brief Get the position of a window.
slouken@7191
   574
 *
philipp@7175
   575
 *  \param window   The window to query.
slime73@9995
   576
 *  \param x        Pointer to variable for storing the x position, in screen
slime73@9995
   577
 *                  coordinates. May be NULL.
slime73@9995
   578
 *  \param y        Pointer to variable for storing the y position, in screen
slime73@9995
   579
 *                  coordinates. May be NULL.
aschiffler@6984
   580
 *
slouken@3407
   581
 *  \sa SDL_SetWindowPosition()
slouken@1895
   582
 */
slouken@3685
   583
extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_Window * window,
slouken@1895
   584
                                                   int *x, int *y);
slouken@1895
   585
slouken@1895
   586
/**
slouken@4883
   587
 *  \brief Set the size of a window's client area.
slouken@7191
   588
 *
philipp@7175
   589
 *  \param window   The window to resize.
slime73@9995
   590
 *  \param w        The width of the window, in screen coordinates. Must be >0.
slime73@9995
   591
 *  \param h        The height of the window, in screen coordinates. Must be >0.
aschiffler@6984
   592
 *
slouken@3407
   593
 *  \note You can't change the size of a fullscreen window, it automatically
slouken@3407
   594
 *        matches the size of the display mode.
slouken@7191
   595
 *
slime73@9995
   596
 *  The window size in screen coordinates may differ from the size in pixels, if
slime73@9995
   597
 *  the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with
philipp@9996
   598
 *  high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or
philipp@9996
   599
 *  SDL_GetRendererOutputSize() to get the real client area size in pixels.
slime73@9995
   600
 *
slouken@3407
   601
 *  \sa SDL_GetWindowSize()
slouken@1895
   602
 */
slouken@3685
   603
extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_Window * window, int w,
slouken@1895
   604
                                               int h);
slouken@1895
   605
slouken@1895
   606
/**
slouken@4883
   607
 *  \brief Get the size of a window's client area.
slouken@7191
   608
 *
philipp@7175
   609
 *  \param window   The window to query.
slime73@9995
   610
 *  \param w        Pointer to variable for storing the width, in screen
slime73@9995
   611
 *                  coordinates. May be NULL.
slime73@9995
   612
 *  \param h        Pointer to variable for storing the height, in screen
slime73@9995
   613
 *                  coordinates. May be NULL.
slime73@9995
   614
 *
slime73@9995
   615
 *  The window size in screen coordinates may differ from the size in pixels, if
slime73@9995
   616
 *  the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with
philipp@9996
   617
 *  high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or
philipp@9996
   618
 *  SDL_GetRendererOutputSize() to get the real client area size in pixels.
slouken@7191
   619
 *
slouken@3407
   620
 *  \sa SDL_SetWindowSize()
slouken@1895
   621
 */
slouken@3685
   622
extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_Window * window, int *w,
slouken@1895
   623
                                               int *h);
slouken@7191
   624
stopiccot@6681
   625
/**
icculus@10024
   626
 *  \brief Get the size of a window's borders (decorations) around the client area.
icculus@10024
   627
 *
icculus@10024
   628
 *  \param window The window to query.
icculus@10024
   629
 *  \param top Pointer to variable for storing the size of the top border. NULL is permitted.
icculus@10024
   630
 *  \param left Pointer to variable for storing the size of the left border. NULL is permitted.
icculus@10024
   631
 *  \param bottom Pointer to variable for storing the size of the bottom border. NULL is permitted.
icculus@10024
   632
 *  \param right Pointer to variable for storing the size of the right border. NULL is permitted.
icculus@10024
   633
 *
icculus@10024
   634
 *  \return 0 on success, or -1 if getting this information is not supported.
icculus@10024
   635
 *
icculus@10024
   636
 *  \note if this function fails (returns -1), the size values will be
icculus@10024
   637
 *        initialized to 0, 0, 0, 0 (if a non-NULL pointer is provided), as
icculus@10024
   638
 *        if the window in question was borderless.
icculus@10024
   639
 */
icculus@10024
   640
extern DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window * window,
icculus@10024
   641
                                                     int *top, int *left,
icculus@10024
   642
                                                     int *bottom, int *right);
icculus@10024
   643
icculus@10024
   644
/**
stopiccot@6681
   645
 *  \brief Set the minimum size of a window's client area.
slouken@7191
   646
 *
philipp@7175
   647
 *  \param window    The window to set a new minimum size.
aschiffler@6984
   648
 *  \param min_w     The minimum width of the window, must be >0
aschiffler@6984
   649
 *  \param min_h     The minimum height of the window, must be >0
stopiccot@6681
   650
 *
stopiccot@6681
   651
 *  \note You can't change the minimum size of a fullscreen window, it
stopiccot@6681
   652
 *        automatically matches the size of the display mode.
stopiccot@6681
   653
 *
stopiccot@6681
   654
 *  \sa SDL_GetWindowMinimumSize()
slouken@6788
   655
 *  \sa SDL_SetWindowMaximumSize()
stopiccot@6681
   656
 */
stopiccot@6681
   657
extern DECLSPEC void SDLCALL SDL_SetWindowMinimumSize(SDL_Window * window,
stopiccot@6681
   658
                                                      int min_w, int min_h);
slouken@7191
   659
stopiccot@6681
   660
/**
stopiccot@6681
   661
 *  \brief Get the minimum size of a window's client area.
slouken@7191
   662
 *
philipp@7175
   663
 *  \param window   The window to query.
aschiffler@6984
   664
 *  \param w        Pointer to variable for storing the minimum width, may be NULL
aschiffler@6984
   665
 *  \param h        Pointer to variable for storing the minimum height, may be NULL
slouken@7191
   666
 *
slouken@6788
   667
 *  \sa SDL_GetWindowMaximumSize()
stopiccot@6681
   668
 *  \sa SDL_SetWindowMinimumSize()
stopiccot@6681
   669
 */
stopiccot@6681
   670
extern DECLSPEC void SDLCALL SDL_GetWindowMinimumSize(SDL_Window * window,
stopiccot@6681
   671
                                                      int *w, int *h);
slouken@1895
   672
slouken@1895
   673
/**
slouken@6788
   674
 *  \brief Set the maximum size of a window's client area.
slouken@6788
   675
 *
philipp@7175
   676
 *  \param window    The window to set a new maximum size.
aschiffler@6984
   677
 *  \param max_w     The maximum width of the window, must be >0
aschiffler@6984
   678
 *  \param max_h     The maximum height of the window, must be >0
aschiffler@6984
   679
 *
slouken@6788
   680
 *  \note You can't change the maximum size of a fullscreen window, it
slouken@6788
   681
 *        automatically matches the size of the display mode.
slouken@6788
   682
 *
slouken@6788
   683
 *  \sa SDL_GetWindowMaximumSize()
slouken@6788
   684
 *  \sa SDL_SetWindowMinimumSize()
slouken@6788
   685
 */
slouken@6788
   686
extern DECLSPEC void SDLCALL SDL_SetWindowMaximumSize(SDL_Window * window,
slouken@6788
   687
                                                      int max_w, int max_h);
slouken@7191
   688
slouken@6788
   689
/**
slouken@6788
   690
 *  \brief Get the maximum size of a window's client area.
slouken@7191
   691
 *
philipp@7175
   692
 *  \param window   The window to query.
aschiffler@6984
   693
 *  \param w        Pointer to variable for storing the maximum width, may be NULL
aschiffler@6984
   694
 *  \param h        Pointer to variable for storing the maximum height, may be NULL
slouken@6788
   695
 *
slouken@6788
   696
 *  \sa SDL_GetWindowMinimumSize()
slouken@6788
   697
 *  \sa SDL_SetWindowMaximumSize()
slouken@6788
   698
 */
slouken@6788
   699
extern DECLSPEC void SDLCALL SDL_GetWindowMaximumSize(SDL_Window * window,
slouken@6788
   700
                                                      int *w, int *h);
slouken@6788
   701
slouken@6788
   702
/**
icculus@6422
   703
 *  \brief Set the border state of a window.
icculus@6422
   704
 *
icculus@6422
   705
 *  This will add or remove the window's SDL_WINDOW_BORDERLESS flag and
icculus@6422
   706
 *  add or remove the border from the actual window. This is a no-op if the
icculus@6422
   707
 *  window's border already matches the requested state.
icculus@6422
   708
 *
icculus@6422
   709
 *  \param window The window of which to change the border state.
icculus@6422
   710
 *  \param bordered SDL_FALSE to remove border, SDL_TRUE to add border.
icculus@6422
   711
 *
icculus@6422
   712
 *  \note You can't change the border state of a fullscreen window.
slouken@7191
   713
 *
icculus@6422
   714
 *  \sa SDL_GetWindowFlags()
icculus@6422
   715
 */
icculus@6422
   716
extern DECLSPEC void SDLCALL SDL_SetWindowBordered(SDL_Window * window,
icculus@6422
   717
                                                   SDL_bool bordered);
icculus@6422
   718
icculus@6422
   719
/**
icculus@10385
   720
 *  \brief Set the user-resizable state of a window.
icculus@10385
   721
 *
icculus@10385
   722
 *  This will add or remove the window's SDL_WINDOW_RESIZABLE flag and
icculus@10385
   723
 *  allow/disallow user resizing of the window. This is a no-op if the
icculus@10385
   724
 *  window's resizable state already matches the requested state.
icculus@10385
   725
 *
icculus@10385
   726
 *  \param window The window of which to change the resizable state.
icculus@10385
   727
 *  \param resizable SDL_TRUE to allow resizing, SDL_FALSE to disallow.
icculus@10385
   728
 *
icculus@10385
   729
 *  \note You can't change the resizable state of a fullscreen window.
icculus@10385
   730
 *
icculus@10385
   731
 *  \sa SDL_GetWindowFlags()
icculus@10385
   732
 */
icculus@10385
   733
extern DECLSPEC void SDLCALL SDL_SetWindowResizable(SDL_Window * window,
icculus@10385
   734
                                                    SDL_bool resizable);
icculus@10385
   735
icculus@10385
   736
/**
slouken@4883
   737
 *  \brief Show a window.
slouken@7191
   738
 *
slouken@3407
   739
 *  \sa SDL_HideWindow()
slouken@1895
   740
 */
slouken@3685
   741
extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_Window * window);
slouken@1895
   742
slouken@1895
   743
/**
slouken@4883
   744
 *  \brief Hide a window.
slouken@7191
   745
 *
slouken@3407
   746
 *  \sa SDL_ShowWindow()
slouken@1895
   747
 */
slouken@3685
   748
extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_Window * window);
slouken@1895
   749
slouken@1895
   750
/**
slouken@4883
   751
 *  \brief Raise a window above other windows and set the input focus.
slouken@1895
   752
 */
slouken@3685
   753
extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_Window * window);
slouken@1895
   754
slouken@1895
   755
/**
slouken@4883
   756
 *  \brief Make a window as large as possible.
slouken@7191
   757
 *
slouken@3407
   758
 *  \sa SDL_RestoreWindow()
slouken@1895
   759
 */
slouken@3685
   760
extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_Window * window);
slouken@1895
   761
slouken@1895
   762
/**
slouken@4883
   763
 *  \brief Minimize a window to an iconic representation.
slouken@7191
   764
 *
slouken@3407
   765
 *  \sa SDL_RestoreWindow()
slouken@1895
   766
 */
slouken@3685
   767
extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_Window * window);
slouken@1895
   768
slouken@1895
   769
/**
slouken@3407
   770
 *  \brief Restore the size and position of a minimized or maximized window.
slouken@7191
   771
 *
slouken@3407
   772
 *  \sa SDL_MaximizeWindow()
slouken@3407
   773
 *  \sa SDL_MinimizeWindow()
slouken@1895
   774
 */
slouken@3685
   775
extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window * window);
slouken@1895
   776
slouken@1895
   777
/**
slouken@4883
   778
 *  \brief Set a window's fullscreen state.
slouken@7191
   779
 *
slouken@3407
   780
 *  \return 0 on success, or -1 if setting the display mode failed.
slouken@7191
   781
 *
slouken@3522
   782
 *  \sa SDL_SetWindowDisplayMode()
slouken@3522
   783
 *  \sa SDL_GetWindowDisplayMode()
slouken@1895
   784
 */
slouken@3685
   785
extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window,
slouken@6755
   786
                                                    Uint32 flags);
slouken@1895
   787
slouken@1895
   788
/**
slouken@5546
   789
 *  \brief Get the SDL surface associated with the window.
slouken@5166
   790
 *
slouken@7191
   791
 *  \return The window's framebuffer surface, or NULL on error.
slouken@5546
   792
 *
slouken@5546
   793
 *  A new surface will be created with the optimal format for the window,
slouken@5546
   794
 *  if necessary. This surface will be freed when the window is destroyed.
slouken@5166
   795
 *
slouken@5166
   796
 *  \note You may not combine this with 3D or the rendering API on this window.
slouken@5166
   797
 *
slouken@5166
   798
 *  \sa SDL_UpdateWindowSurface()
slouken@5166
   799
 *  \sa SDL_UpdateWindowSurfaceRects()
slouken@5166
   800
 */
slouken@5166
   801
extern DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window * window);
slouken@5166
   802
slouken@5166
   803
/**
slouken@5166
   804
 *  \brief Copy the window surface to the screen.
slouken@5166
   805
 *
slouken@5166
   806
 *  \return 0 on success, or -1 on error.
slouken@5166
   807
 *
slouken@5166
   808
 *  \sa SDL_GetWindowSurface()
slouken@5166
   809
 *  \sa SDL_UpdateWindowSurfaceRects()
slouken@5166
   810
 */
slouken@5166
   811
extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window);
slouken@5166
   812
slouken@5166
   813
/**
slouken@5166
   814
 *  \brief Copy a number of rectangles on the window surface to the screen.
slouken@5166
   815
 *
slouken@5166
   816
 *  \return 0 on success, or -1 on error.
slouken@5166
   817
 *
slouken@5166
   818
 *  \sa SDL_GetWindowSurface()
philipp@10221
   819
 *  \sa SDL_UpdateWindowSurface()
slouken@5166
   820
 */
slouken@5166
   821
extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window,
slouken@7014
   822
                                                         const SDL_Rect * rects,
slouken@5297
   823
                                                         int numrects);
slouken@5166
   824
slouken@5166
   825
/**
slouken@4883
   826
 *  \brief Set a window's input grab mode.
slouken@7191
   827
 *
philipp@7188
   828
 *  \param window The window for which the input grab mode should be set.
slouken@5403
   829
 *  \param grabbed This is SDL_TRUE to grab input, and SDL_FALSE to release input.
slouken@7191
   830
 *
icculus@9447
   831
 *  If the caller enables a grab while another window is currently grabbed,
icculus@9447
   832
 *  the other window loses its grab in favor of the caller's window.
icculus@9447
   833
 *
slouken@3407
   834
 *  \sa SDL_GetWindowGrab()
slouken@1895
   835
 */
slouken@3685
   836
extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window * window,
slouken@5403
   837
                                               SDL_bool grabbed);
slouken@1895
   838
slouken@1895
   839
/**
slouken@4883
   840
 *  \brief Get a window's input grab mode.
slouken@7191
   841
 *
slouken@5403
   842
 *  \return This returns SDL_TRUE if input is grabbed, and SDL_FALSE otherwise.
slouken@7191
   843
 *
slouken@3407
   844
 *  \sa SDL_SetWindowGrab()
slouken@1895
   845
 */
slouken@5403
   846
extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowGrab(SDL_Window * window);
slouken@1895
   847
slouken@1895
   848
/**
icculus@9447
   849
 *  \brief Get the window that currently has an input grab enabled.
icculus@9447
   850
 *
icculus@9447
   851
 *  \return This returns the window if input is grabbed, and NULL otherwise.
icculus@9447
   852
 *
icculus@9447
   853
 *  \sa SDL_SetWindowGrab()
icculus@9447
   854
 */
icculus@9447
   855
extern DECLSPEC SDL_Window * SDLCALL SDL_GetGrabbedWindow(void);
icculus@9447
   856
icculus@9447
   857
/**
slouken@5466
   858
 *  \brief Set the brightness (gamma correction) for a window.
slouken@7191
   859
 *
slouken@5466
   860
 *  \return 0 on success, or -1 if setting the brightness isn't supported.
slouken@7191
   861
 *
slouken@5466
   862
 *  \sa SDL_GetWindowBrightness()
slouken@5466
   863
 *  \sa SDL_SetWindowGammaRamp()
slouken@5466
   864
 */
slouken@5466
   865
extern DECLSPEC int SDLCALL SDL_SetWindowBrightness(SDL_Window * window, float brightness);
slouken@5466
   866
slouken@5466
   867
/**
slouken@5466
   868
 *  \brief Get the brightness (gamma correction) for a window.
slouken@7191
   869
 *
slouken@5466
   870
 *  \return The last brightness value passed to SDL_SetWindowBrightness()
slouken@7191
   871
 *
slouken@5466
   872
 *  \sa SDL_SetWindowBrightness()
slouken@5466
   873
 */
slouken@5466
   874
extern DECLSPEC float SDLCALL SDL_GetWindowBrightness(SDL_Window * window);
slouken@5466
   875
slouken@5466
   876
/**
icculus@10025
   877
 *  \brief Set the opacity for a window
icculus@10025
   878
 *
icculus@10025
   879
 *  \param window The window which will be made transparent or opaque
icculus@10025
   880
 *  \param opacity Opacity (0.0f - transparent, 1.0f - opaque) This will be
icculus@10025
   881
 *                 clamped internally between 0.0f and 1.0f.
icculus@10025
   882
 * 
icculus@10025
   883
 *  \return 0 on success, or -1 if setting the opacity isn't supported.
icculus@10025
   884
 *
icculus@10025
   885
 *  \sa SDL_GetWindowOpacity()
icculus@10025
   886
 */
icculus@10025
   887
extern DECLSPEC int SDLCALL SDL_SetWindowOpacity(SDL_Window * window, float opacity);
icculus@10025
   888
icculus@10025
   889
/**
icculus@10025
   890
 *  \brief Get the opacity of a window.
icculus@10025
   891
 *
icculus@10025
   892
 *  If transparency isn't supported on this platform, opacity will be reported
icculus@10025
   893
 *  as 1.0f without error.
icculus@10025
   894
 *
icculus@10025
   895
 *  \param window The window in question.
philipp@10035
   896
 *  \param out_opacity Opacity (0.0f - transparent, 1.0f - opaque)
icculus@10025
   897
 *
icculus@10025
   898
 *  \return 0 on success, or -1 on error (invalid window, etc).
icculus@10025
   899
 *
icculus@10025
   900
 *  \sa SDL_SetWindowOpacity()
icculus@10025
   901
 */
icculus@10025
   902
extern DECLSPEC int SDLCALL SDL_GetWindowOpacity(SDL_Window * window, float * out_opacity);
icculus@10025
   903
icculus@10025
   904
/**
philipp@10035
   905
 *  \brief Sets the window as a modal for another window (TODO: reconsider this function and/or its name)
icculus@10027
   906
 *
icculus@10027
   907
 *  \param modal_window The window that should be modal
icculus@10027
   908
 *  \param parent_window The parent window
icculus@10027
   909
 * 
icculus@10027
   910
 *  \return 0 on success, or -1 otherwise.
icculus@10027
   911
 */
icculus@10027
   912
extern DECLSPEC int SDLCALL SDL_SetWindowModalFor(SDL_Window * modal_window, SDL_Window * parent_window);
icculus@10027
   913
icculus@10027
   914
/**
icculus@10026
   915
 *  \brief Explicitly sets input focus to the window.
icculus@10026
   916
 *
icculus@10026
   917
 *  You almost certainly want SDL_RaiseWindow() instead of this function. Use
icculus@10026
   918
 *  this with caution, as you might give focus to a window that's completely
icculus@10026
   919
 *  obscured by other windows.
icculus@10026
   920
 *
icculus@10026
   921
 *  \param window The window that should get the input focus
icculus@10026
   922
 * 
icculus@10026
   923
 *  \return 0 on success, or -1 otherwise.
icculus@10026
   924
 *  \sa SDL_RaiseWindow()
icculus@10026
   925
 */
icculus@10026
   926
extern DECLSPEC int SDLCALL SDL_SetWindowInputFocus(SDL_Window * window);
icculus@10026
   927
icculus@10026
   928
/**
slouken@5466
   929
 *  \brief Set the gamma ramp for a window.
slouken@7191
   930
 *
philipp@7188
   931
 *  \param window The window for which the gamma ramp should be set.
slouken@5466
   932
 *  \param red The translation table for the red channel, or NULL.
slouken@5466
   933
 *  \param green The translation table for the green channel, or NULL.
slouken@5466
   934
 *  \param blue The translation table for the blue channel, or NULL.
slouken@7191
   935
 *
slouken@5466
   936
 *  \return 0 on success, or -1 if gamma ramps are unsupported.
slouken@7191
   937
 *
slouken@5466
   938
 *  Set the gamma translation table for the red, green, and blue channels
slouken@5466
   939
 *  of the video hardware.  Each table is an array of 256 16-bit quantities,
slouken@5466
   940
 *  representing a mapping between the input and output for that channel.
slouken@5466
   941
 *  The input is the index into the array, and the output is the 16-bit
slouken@5466
   942
 *  gamma value at that index, scaled to the output color precision.
slouken@5466
   943
 *
slouken@5504
   944
 *  \sa SDL_GetWindowGammaRamp()
slouken@5466
   945
 */
slouken@5466
   946
extern DECLSPEC int SDLCALL SDL_SetWindowGammaRamp(SDL_Window * window,
slouken@5466
   947
                                                   const Uint16 * red,
slouken@5466
   948
                                                   const Uint16 * green,
slouken@5466
   949
                                                   const Uint16 * blue);
slouken@5466
   950
slouken@5466
   951
/**
slouken@5466
   952
 *  \brief Get the gamma ramp for a window.
slouken@7191
   953
 *
philipp@7188
   954
 *  \param window The window from which the gamma ramp should be queried.
slouken@7191
   955
 *  \param red   A pointer to a 256 element array of 16-bit quantities to hold
slouken@5466
   956
 *               the translation table for the red channel, or NULL.
slouken@7191
   957
 *  \param green A pointer to a 256 element array of 16-bit quantities to hold
slouken@5466
   958
 *               the translation table for the green channel, or NULL.
slouken@7191
   959
 *  \param blue  A pointer to a 256 element array of 16-bit quantities to hold
slouken@5466
   960
 *               the translation table for the blue channel, or NULL.
slouken@7191
   961
 *
slouken@5466
   962
 *  \return 0 on success, or -1 if gamma ramps are unsupported.
slouken@7191
   963
 *
slouken@5466
   964
 *  \sa SDL_SetWindowGammaRamp()
slouken@5466
   965
 */
slouken@5466
   966
extern DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window * window,
slouken@5466
   967
                                                   Uint16 * red,
slouken@5466
   968
                                                   Uint16 * green,
slouken@5466
   969
                                                   Uint16 * blue);
slouken@5466
   970
icculus@8937
   971
/**
icculus@8937
   972
 *  \brief Possible return values from the SDL_HitTest callback.
icculus@8937
   973
 *
icculus@8937
   974
 *  \sa SDL_HitTest
icculus@8937
   975
 */
icculus@8935
   976
typedef enum
icculus@8935
   977
{
icculus@8935
   978
    SDL_HITTEST_NORMAL,  /**< Region is normal. No special properties. */
icculus@8935
   979
    SDL_HITTEST_DRAGGABLE,  /**< Region can drag entire window. */
ionut@8946
   980
    SDL_HITTEST_RESIZE_TOPLEFT,
ionut@8946
   981
    SDL_HITTEST_RESIZE_TOP,
ionut@8946
   982
    SDL_HITTEST_RESIZE_TOPRIGHT,
ionut@8946
   983
    SDL_HITTEST_RESIZE_RIGHT,
ionut@8946
   984
    SDL_HITTEST_RESIZE_BOTTOMRIGHT,
ionut@8946
   985
    SDL_HITTEST_RESIZE_BOTTOM,
ionut@8946
   986
    SDL_HITTEST_RESIZE_BOTTOMLEFT,
ionut@8946
   987
    SDL_HITTEST_RESIZE_LEFT
icculus@8935
   988
} SDL_HitTestResult;
icculus@8935
   989
icculus@8937
   990
/**
icculus@8937
   991
 *  \brief Callback used for hit-testing.
icculus@8937
   992
 *
icculus@8937
   993
 *  \sa SDL_SetWindowHitTest
icculus@8937
   994
 */
icculus@8935
   995
typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win,
icculus@8935
   996
                                                 const SDL_Point *area,
icculus@8935
   997
                                                 void *data);
icculus@8935
   998
slouken@5466
   999
/**
icculus@8935
  1000
 *  \brief Provide a callback that decides if a window region has special properties.
icculus@8931
  1001
 *
icculus@8935
  1002
 *  Normally windows are dragged and resized by decorations provided by the
icculus@8935
  1003
 *  system window manager (a title bar, borders, etc), but for some apps, it
icculus@8935
  1004
 *  makes sense to drag them from somewhere else inside the window itself; for
icculus@8935
  1005
 *  example, one might have a borderless window that wants to be draggable
icculus@8935
  1006
 *  from any part, or simulate its own title bar, etc.
icculus@8931
  1007
 *
icculus@8935
  1008
 *  This function lets the app provide a callback that designates pieces of
icculus@8935
  1009
 *  a given window as special. This callback is run during event processing
icculus@8935
  1010
 *  if we need to tell the OS to treat a region of the window specially; the
icculus@8935
  1011
 *  use of this callback is known as "hit testing."
icculus@8931
  1012
 *
icculus@8931
  1013
 *  Mouse input may not be delivered to your application if it is within
icculus@8935
  1014
 *  a special area; the OS will often apply that input to moving the window or
icculus@8935
  1015
 *  resizing the window and not deliver it to the application.
icculus@8935
  1016
 *
icculus@8935
  1017
 *  Specifying NULL for a callback disables hit-testing. Hit-testing is
icculus@8935
  1018
 *  disabled by default.
icculus@8931
  1019
 *
icculus@8931
  1020
 *  Platforms that don't support this functionality will return -1
icculus@8935
  1021
 *  unconditionally, even if you're attempting to disable hit-testing.
icculus@8931
  1022
 *
icculus@8937
  1023
 *  Your callback may fire at any time, and its firing does not indicate any
icculus@8937
  1024
 *  specific behavior (for example, on Windows, this certainly might fire
icculus@8937
  1025
 *  when the OS is deciding whether to drag your window, but it fires for lots
icculus@8937
  1026
 *  of other reasons, too, some unrelated to anything you probably care about
icculus@8937
  1027
 *  _and when the mouse isn't actually at the location it is testing_).
icculus@8937
  1028
 *  Since this can fire at any time, you should try to keep your callback
icculus@8937
  1029
 *  efficient, devoid of allocations, etc.
icculus@8935
  1030
 *
icculus@8935
  1031
 *  \param window The window to set hit-testing on.
icculus@8935
  1032
 *  \param callback The callback to call when doing a hit-test.
icculus@8935
  1033
 *  \param callback_data An app-defined void pointer passed to the callback.
icculus@8931
  1034
 *  \return 0 on success, -1 on error (including unsupported).
icculus@8931
  1035
 */
icculus@8935
  1036
extern DECLSPEC int SDLCALL SDL_SetWindowHitTest(SDL_Window * window,
icculus@8935
  1037
                                                 SDL_HitTest callback,
icculus@8935
  1038
                                                 void *callback_data);
icculus@8931
  1039
icculus@8931
  1040
/**
slouken@3407
  1041
 *  \brief Destroy a window.
slouken@1895
  1042
 */
slouken@3685
  1043
extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window * window);
slouken@1895
  1044
slouken@0
  1045
slouken@3025
  1046
/**
philipp@10175
  1047
 *  \brief Returns whether the screensaver is currently enabled (default off).
slouken@7191
  1048
 *
slouken@3407
  1049
 *  \sa SDL_EnableScreenSaver()
slouken@3407
  1050
 *  \sa SDL_DisableScreenSaver()
slouken@3025
  1051
 */
couriersud@3033
  1052
extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void);
slouken@3025
  1053
slouken@3025
  1054
/**
slouken@3407
  1055
 *  \brief Allow the screen to be blanked by a screensaver
slouken@7191
  1056
 *
slouken@3407
  1057
 *  \sa SDL_IsScreenSaverEnabled()
slouken@3407
  1058
 *  \sa SDL_DisableScreenSaver()
slouken@3025
  1059
 */
couriersud@3033
  1060
extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void);
slouken@3025
  1061
slouken@3025
  1062
/**
slouken@3407
  1063
 *  \brief Prevent the screen from being blanked by a screensaver
slouken@7191
  1064
 *
slouken@3407
  1065
 *  \sa SDL_IsScreenSaverEnabled()
slouken@3407
  1066
 *  \sa SDL_EnableScreenSaver()
slouken@3025
  1067
 */
couriersud@3033
  1068
extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void);
slouken@3025
  1069
slouken@0
  1070
slouken@3407
  1071
/**
slouken@3407
  1072
 *  \name OpenGL support functions
slouken@3407
  1073
 */
gabomdq@7678
  1074
/* @{ */
slouken@0
  1075
slouken@1895
  1076
/**
slouken@3407
  1077
 *  \brief Dynamically load an OpenGL library.
slouken@7191
  1078
 *
slouken@7191
  1079
 *  \param path The platform dependent OpenGL library name, or NULL to open the
slouken@3407
  1080
 *              default OpenGL library.
slouken@7191
  1081
 *
slouken@3407
  1082
 *  \return 0 on success, or -1 if the library couldn't be loaded.
slouken@7191
  1083
 *
slouken@3407
  1084
 *  This should be done after initializing the video driver, but before
slouken@3407
  1085
 *  creating any OpenGL windows.  If no OpenGL library is loaded, the default
slouken@3407
  1086
 *  library will be loaded upon creation of the first OpenGL window.
slouken@7191
  1087
 *
slouken@3407
  1088
 *  \note If you do this, you need to retrieve all of the GL functions used in
slouken@3407
  1089
 *        your program from the dynamic library using SDL_GL_GetProcAddress().
slouken@7191
  1090
 *
slouken@3407
  1091
 *  \sa SDL_GL_GetProcAddress()
slouken@3407
  1092
 *  \sa SDL_GL_UnloadLibrary()
slouken@0
  1093
 */
slouken@337
  1094
extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
slouken@0
  1095
slouken@1895
  1096
/**
slouken@3407
  1097
 *  \brief Get the address of an OpenGL function.
slouken@0
  1098
 */
slouken@1895
  1099
extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc);
slouken@0
  1100
slouken@1895
  1101
/**
slouken@3407
  1102
 *  \brief Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary().
slouken@7191
  1103
 *
slouken@3407
  1104
 *  \sa SDL_GL_LoadLibrary()
slouken@3057
  1105
 */
slouken@3057
  1106
extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void);
slouken@3057
  1107
slouken@3057
  1108
/**
slouken@7191
  1109
 *  \brief Return true if an OpenGL extension is supported for the current
slouken@3407
  1110
 *         context.
slouken@1926
  1111
 */
slouken@1926
  1112
extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char
slouken@1926
  1113
                                                           *extension);
slouken@1926
  1114
slouken@1926
  1115
/**
jorgen@8145
  1116
 *  \brief Reset all previously set OpenGL context attributes to their default values
jorgen@8145
  1117
 */
jorgen@8145
  1118
extern DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void);
jorgen@8145
  1119
jorgen@8145
  1120
/**
slouken@3407
  1121
 *  \brief Set an OpenGL window attribute before window creation.
slouken@11171
  1122
 *
slouken@11171
  1123
 *  \return 0 on success, or -1 if the attribute could not be set.
slouken@0
  1124
 */
slouken@337
  1125
extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
slouken@0
  1126
slouken@1895
  1127
/**
slouken@3407
  1128
 *  \brief Get the actual value for an attribute from the current context.
slouken@11171
  1129
 *
slouken@11171
  1130
 *  \return 0 on success, or -1 if the attribute could not be retrieved.
slouken@11171
  1131
 *          The integer at \c value will be modified in either case.
slouken@0
  1132
 */
slouken@1936
  1133
extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value);
slouken@0
  1134
slouken@1895
  1135
/**
slouken@7191
  1136
 *  \brief Create an OpenGL context for use with an OpenGL window, and make it
slouken@3407
  1137
 *         current.
slouken@7191
  1138
 *
slouken@3407
  1139
 *  \sa SDL_GL_DeleteContext()
slouken@1895
  1140
 */
slouken@3685
  1141
extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window *
slouken@3685
  1142
                                                           window);
slouken@1895
  1143
slouken@1895
  1144
/**
slouken@3407
  1145
 *  \brief Set up an OpenGL context for rendering into an OpenGL window.
slouken@7191
  1146
 *
slouken@3407
  1147
 *  \note The context must have been created with a compatible window.
slouken@1895
  1148
 */
slouken@3685
  1149
extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_Window * window,
slouken@1895
  1150
                                               SDL_GLContext context);
slouken@1895
  1151
slouken@1895
  1152
/**
slouken@7412
  1153
 *  \brief Get the currently active OpenGL window.
slouken@7412
  1154
 */
slouken@7412
  1155
extern DECLSPEC SDL_Window* SDLCALL SDL_GL_GetCurrentWindow(void);
slouken@7412
  1156
slouken@7412
  1157
/**
slouken@7412
  1158
 *  \brief Get the currently active OpenGL context.
slouken@7412
  1159
 */
slouken@7412
  1160
extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void);
slouken@7412
  1161
slouken@7412
  1162
/**
slime73@9995
  1163
 *  \brief Get the size of a window's underlying drawable in pixels (for use
slime73@9995
  1164
 *         with glViewport).
urkle@7746
  1165
 *
philipp@7752
  1166
 *  \param window   Window from which the drawable size should be queried
slime73@9995
  1167
 *  \param w        Pointer to variable for storing the width in pixels, may be NULL
slime73@9995
  1168
 *  \param h        Pointer to variable for storing the height in pixels, may be NULL
urkle@7746
  1169
 *
philipp@8777
  1170
 * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI
urkle@7746
  1171
 * drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a
urkle@7746
  1172
 * platform with high-DPI support (Apple calls this "Retina"), and not disabled
urkle@7746
  1173
 * by the SDL_HINT_VIDEO_HIGHDPI_DISABLED hint.
urkle@7746
  1174
 *
urkle@7746
  1175
 *  \sa SDL_GetWindowSize()
urkle@7746
  1176
 *  \sa SDL_CreateWindow()
urkle@7746
  1177
 */
urkle@7746
  1178
extern DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window * window, int *w,
urkle@7746
  1179
                                                    int *h);
urkle@7746
  1180
urkle@7746
  1181
/**
slouken@3407
  1182
 *  \brief Set the swap interval for the current OpenGL context.
slouken@7191
  1183
 *
slouken@3407
  1184
 *  \param interval 0 for immediate updates, 1 for updates synchronized with the
icculus@6382
  1185
 *                  vertical retrace. If the system supports it, you may
icculus@6382
  1186
 *                  specify -1 to allow late swaps to happen immediately
icculus@6382
  1187
 *                  instead of waiting for the next retrace.
slouken@7191
  1188
 *
slouken@3407
  1189
 *  \return 0 on success, or -1 if setting the swap interval is not supported.
slouken@7191
  1190
 *
slouken@3407
  1191
 *  \sa SDL_GL_GetSwapInterval()
slouken@1895
  1192
 */
slouken@1895
  1193
extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval);
slouken@1895
  1194
slouken@1895
  1195
/**
slouken@3407
  1196
 *  \brief Get the swap interval for the current OpenGL context.
slouken@7191
  1197
 *
slouken@7191
  1198
 *  \return 0 if there is no vertical retrace synchronization, 1 if the buffer
icculus@6382
  1199
 *          swap is synchronized with the vertical retrace, and -1 if late
icculus@6382
  1200
 *          swaps happen immediately instead of waiting for the next retrace.
icculus@6382
  1201
 *          If the system can't determine the swap interval, or there isn't a
icculus@6382
  1202
 *          valid current context, this will return 0 as a safe default.
slouken@7191
  1203
 *
slouken@3407
  1204
 *  \sa SDL_GL_SetSwapInterval()
slouken@1895
  1205
 */
slouken@1895
  1206
extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void);
slouken@1895
  1207
slouken@1895
  1208
/**
slouken@7191
  1209
 * \brief Swap the OpenGL buffers for a window, if double-buffering is
slouken@3407
  1210
 *        supported.
slouken@0
  1211
 */
slouken@10700
  1212
extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_Window * window);
slouken@0
  1213
slouken@1895
  1214
/**
slouken@3407
  1215
 *  \brief Delete an OpenGL context.
slouken@7191
  1216
 *
slouken@3407
  1217
 *  \sa SDL_GL_CreateContext()
slouken@0
  1218
 */
slouken@1895
  1219
extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context);
slouken@0
  1220
gabomdq@7678
  1221
/* @} *//* OpenGL support functions */
slouken@3407
  1222
slouken@0
  1223
slouken@0
  1224
/* Ends C function definitions when using C++ */
slouken@0
  1225
#ifdef __cplusplus
slouken@0
  1226
}
slouken@0
  1227
#endif
slouken@0
  1228
#include "close_code.h"
slouken@0
  1229
slouken@10638
  1230
#endif /* SDL_video_h_ */
slouken@1895
  1231
slouken@1895
  1232
/* vi: set ts=4 sw=4 expandtab: */