include/SDL_video.h
author Sam Lantinga <slouken@libsdl.org>
Fri, 02 Jan 2009 17:39:48 +0000
changeset 2967 e4a469d6ddab
parent 2961 9f16a1761fa5
child 2990 502adab079a4
permissions -rw-r--r--
Implemented SDL_SetWindowIcon(), with translucent icon support under X11.
slouken@0
     1
/*
slouken@0
     2
    SDL - Simple DirectMedia Layer
slouken@2859
     3
    Copyright (C) 1997-2009 Sam Lantinga
slouken@0
     4
slouken@0
     5
    This library is free software; you can redistribute it and/or
slouken@1312
     6
    modify it under the terms of the GNU Lesser General Public
slouken@0
     7
    License as published by the Free Software Foundation; either
slouken@1312
     8
    version 2.1 of the License, or (at your option) any later version.
slouken@0
     9
slouken@0
    10
    This library is distributed in the hope that it will be useful,
slouken@0
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@0
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@1312
    13
    Lesser General Public License for more details.
slouken@0
    14
slouken@1312
    15
    You should have received a copy of the GNU Lesser General Public
slouken@1312
    16
    License along with this library; if not, write to the Free Software
slouken@1312
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@0
    18
slouken@0
    19
    Sam Lantinga
slouken@251
    20
    slouken@libsdl.org
slouken@0
    21
*/
slouken@0
    22
slouken@1895
    23
/**
slouken@1895
    24
 * \file SDL_video.h
slouken@1895
    25
 *
slouken@2275
    26
 * Header file for SDL video functions.
slouken@1895
    27
 */
slouken@0
    28
slouken@0
    29
#ifndef _SDL_video_h
slouken@0
    30
#define _SDL_video_h
slouken@0
    31
slouken@1356
    32
#include "SDL_stdinc.h"
slouken@1895
    33
#include "SDL_pixels.h"
slouken@2275
    34
#include "SDL_rect.h"
slouken@2275
    35
#include "SDL_surface.h"
slouken@0
    36
slouken@0
    37
#include "begin_code.h"
slouken@0
    38
/* Set up for C function definitions, even when using C++ */
slouken@0
    39
#ifdef __cplusplus
slouken@1895
    40
/* *INDENT-OFF* */
slouken@0
    41
extern "C" {
slouken@1895
    42
/* *INDENT-ON* */
slouken@0
    43
#endif
slouken@0
    44
slouken@1895
    45
/**
slouken@1895
    46
 * \struct SDL_DisplayMode
slouken@1895
    47
 *
slouken@1895
    48
 * \brief  The structure that defines a display mode
slouken@1895
    49
 *
slouken@1895
    50
 * \sa SDL_GetNumDisplayModes()
slouken@1895
    51
 * \sa SDL_GetDisplayMode()
slouken@1895
    52
 * \sa SDL_GetDesktopDisplayMode()
slouken@1895
    53
 * \sa SDL_GetCurrentDisplayMode()
slouken@1895
    54
 * \sa SDL_GetClosestDisplayMode()
slouken@1895
    55
 * \sa SDL_SetDisplayMode()
slouken@1895
    56
 */
slouken@1895
    57
typedef struct
slouken@1895
    58
{
slouken@1895
    59
    Uint32 format;              /**< pixel format */
slouken@1895
    60
    int w;                      /**< width */
slouken@1895
    61
    int h;                      /**< height */
slouken@1895
    62
    int refresh_rate;           /**< refresh rate (or zero for unspecified) */
slouken@1895
    63
    void *driverdata;           /**< driver-specific data, initialize to 0 */
slouken@1895
    64
} SDL_DisplayMode;
slouken@0
    65
slouken@1895
    66
/**
slouken@1895
    67
 * \typedef SDL_WindowID
slouken@1895
    68
 *
slouken@1895
    69
 * \brief The type used to identify a window
slouken@1895
    70
 *
slouken@1895
    71
 * \sa SDL_CreateWindow()
slouken@1895
    72
 * \sa SDL_CreateWindowFrom()
slouken@1895
    73
 * \sa SDL_DestroyWindow()
slouken@1895
    74
 * \sa SDL_GetWindowData()
slouken@1895
    75
 * \sa SDL_GetWindowFlags()
slouken@1895
    76
 * \sa SDL_GetWindowGrab()
slouken@1895
    77
 * \sa SDL_GetWindowPosition()
slouken@1895
    78
 * \sa SDL_GetWindowSize()
slouken@1895
    79
 * \sa SDL_GetWindowTitle()
slouken@1895
    80
 * \sa SDL_HideWindow()
slouken@1895
    81
 * \sa SDL_MaximizeWindow()
slouken@1895
    82
 * \sa SDL_MinimizeWindow()
slouken@1895
    83
 * \sa SDL_RaiseWindow()
slouken@1895
    84
 * \sa SDL_RestoreWindow()
slouken@1895
    85
 * \sa SDL_SetWindowData()
slouken@1895
    86
 * \sa SDL_SetWindowFullscreen()
slouken@1895
    87
 * \sa SDL_SetWindowGrab()
slouken@1895
    88
 * \sa SDL_SetWindowIcon()
slouken@1895
    89
 * \sa SDL_SetWindowPosition()
slouken@1895
    90
 * \sa SDL_SetWindowSize()
slouken@1895
    91
 * \sa SDL_SetWindowTitle()
slouken@1895
    92
 * \sa SDL_ShowWindow()
slouken@1895
    93
 */
slouken@1895
    94
typedef Uint32 SDL_WindowID;
slouken@0
    95
slouken@1895
    96
/**
slouken@1895
    97
 * \enum SDL_WindowFlags
slouken@1895
    98
 *
slouken@1895
    99
 * \brief The flags on a window
slouken@1895
   100
 *
slouken@1895
   101
 * \sa SDL_GetWindowFlags()
slouken@1895
   102
 */
slouken@1895
   103
typedef enum
slouken@1895
   104
{
slouken@1895
   105
    SDL_WINDOW_FULLSCREEN = 0x00000001,         /**< fullscreen window, implies borderless */
slouken@1895
   106
    SDL_WINDOW_OPENGL = 0x00000002,             /**< window usable with OpenGL context */
slouken@1895
   107
    SDL_WINDOW_SHOWN = 0x00000004,              /**< window is visible */
slouken@1895
   108
    SDL_WINDOW_BORDERLESS = 0x00000008,         /**< no window decoration */
slouken@1895
   109
    SDL_WINDOW_RESIZABLE = 0x00000010,          /**< window can be resized */
slouken@1895
   110
    SDL_WINDOW_MINIMIZED = 0x00000020,          /**< minimized */
slouken@1895
   111
    SDL_WINDOW_MAXIMIZED = 0x00000040,          /**< maximized */
slouken@1895
   112
    SDL_WINDOW_INPUT_GRABBED = 0x00000100,      /**< window has grabbed input focus */
slouken@1895
   113
    SDL_WINDOW_INPUT_FOCUS = 0x00000200,        /**< window has input focus */
slouken@2208
   114
    SDL_WINDOW_MOUSE_FOCUS = 0x00000400         /**< window has mouse focus */
slouken@1895
   115
} SDL_WindowFlags;
slouken@0
   116
slouken@1895
   117
/**
slouken@1895
   118
 * \def SDL_WINDOWPOS_UNDEFINED
slouken@1895
   119
 * \brief Used to indicate that you don't care what the window position is.
slouken@1895
   120
 */
slouken@1895
   121
#define SDL_WINDOWPOS_UNDEFINED 0x7FFFFFF
slouken@1895
   122
/**
slouken@1895
   123
 * \def SDL_WINDOWPOS_CENTERED
slouken@1895
   124
 * \brief Used to indicate that the window position should be centered.
slouken@1895
   125
 */
slouken@1895
   126
#define SDL_WINDOWPOS_CENTERED  0x7FFFFFE
slouken@1895
   127
slouken@1895
   128
/**
slouken@1895
   129
 * \enum SDL_WindowEventID
slouken@1895
   130
 *
slouken@1895
   131
 * \brief Event subtype for window events
slouken@1895
   132
 */
slouken@1895
   133
typedef enum
slouken@1895
   134
{
slouken@1895
   135
    SDL_WINDOWEVENT_NONE,               /**< Never used */
slouken@1895
   136
    SDL_WINDOWEVENT_SHOWN,              /**< Window has been shown */
slouken@1895
   137
    SDL_WINDOWEVENT_HIDDEN,             /**< Window has been hidden */
slouken@1895
   138
    SDL_WINDOWEVENT_EXPOSED,            /**< Window has been exposed and should be redrawn */
slouken@1895
   139
    SDL_WINDOWEVENT_MOVED,              /**< Window has been moved to data1,data2 */
slouken@1895
   140
    SDL_WINDOWEVENT_RESIZED,            /**< Window size changed to data1xdata2 */
slouken@1895
   141
    SDL_WINDOWEVENT_MINIMIZED,          /**< Window has been minimized */
slouken@1895
   142
    SDL_WINDOWEVENT_MAXIMIZED,          /**< Window has been maximized */
slouken@1895
   143
    SDL_WINDOWEVENT_RESTORED,           /**< Window has been restored to normal size and position */
slouken@1895
   144
    SDL_WINDOWEVENT_ENTER,              /**< The window has gained mouse focus */
slouken@1895
   145
    SDL_WINDOWEVENT_LEAVE,              /**< The window has lost mouse focus */
slouken@1895
   146
    SDL_WINDOWEVENT_FOCUS_GAINED,       /**< The window has gained keyboard focus */
slouken@1895
   147
    SDL_WINDOWEVENT_FOCUS_LOST,         /**< The window has lost keyboard focus */
slouken@2208
   148
    SDL_WINDOWEVENT_CLOSE               /**< The window manager requests that the window be closed */
slouken@1895
   149
} SDL_WindowEventID;
slouken@1895
   150
slouken@1895
   151
/**
slouken@1895
   152
 * \enum SDL_RendererFlags
slouken@1895
   153
 *
slouken@1969
   154
 * \brief Flags used when creating a rendering context
slouken@1895
   155
 */
slouken@1895
   156
typedef enum
slouken@1895
   157
{
slouken@1965
   158
    SDL_RENDERER_SINGLEBUFFER = 0x00000001,     /**< Render directly to the window, if possible */
slouken@1965
   159
    SDL_RENDERER_PRESENTCOPY = 0x00000002,      /**< Present uses a copy from back buffer to the front buffer */
slouken@1965
   160
    SDL_RENDERER_PRESENTFLIP2 = 0x00000004,     /**< Present uses a flip, swapping back buffer and front buffer */
slouken@1965
   161
    SDL_RENDERER_PRESENTFLIP3 = 0x00000008,     /**< Present uses a flip, rotating between two back buffers and a front buffer */
slouken@1965
   162
    SDL_RENDERER_PRESENTDISCARD = 0x00000010,   /**< Present leaves the contents of the backbuffer undefined */
slouken@1965
   163
    SDL_RENDERER_PRESENTVSYNC = 0x00000020,     /**< Present is synchronized with the refresh rate */
slouken@2208
   164
    SDL_RENDERER_ACCELERATED = 0x00000040       /**< The renderer uses hardware acceleration */
slouken@1895
   165
} SDL_RendererFlags;
slouken@1895
   166
slouken@1895
   167
/**
slouken@1895
   168
 * \struct SDL_RendererInfo
slouken@1895
   169
 *
slouken@1969
   170
 * \brief Information on the capabilities of a render driver or context
slouken@1895
   171
 */
slouken@1895
   172
typedef struct SDL_RendererInfo
slouken@1895
   173
{
slouken@1895
   174
    const char *name;           /**< The name of the renderer */
slouken@1895
   175
    Uint32 flags;               /**< Supported SDL_RendererFlags */
slouken@1985
   176
    Uint32 mod_modes;           /**< A mask of supported channel modulation */
slouken@1895
   177
    Uint32 blend_modes;         /**< A mask of supported blend modes */
slouken@1895
   178
    Uint32 scale_modes;         /**< A mask of supported scale modes */
slouken@1895
   179
    Uint32 num_texture_formats; /**< The number of available texture formats */
slouken@1920
   180
    Uint32 texture_formats[20]; /**< The available texture formats */
slouken@1895
   181
    int max_texture_width;      /**< The maximimum texture width */
slouken@1895
   182
    int max_texture_height;     /**< The maximimum texture height */
slouken@1895
   183
} SDL_RendererInfo;
slouken@1895
   184
slouken@1895
   185
/**
slouken@1895
   186
 * \enum SDL_TextureAccess
slouken@1895
   187
 *
slouken@1895
   188
 * \brief The access pattern allowed for a texture
slouken@1895
   189
 */
slouken@1895
   190
typedef enum
slouken@1895
   191
{
slouken@2222
   192
    SDL_TEXTUREACCESS_STATIC,    /**< Changes rarely, not lockable */
slouken@2222
   193
    SDL_TEXTUREACCESS_STREAMING  /**< Changes frequently, lockable */
slouken@1895
   194
} SDL_TextureAccess;
slouken@1895
   195
slouken@1895
   196
/**
slouken@1985
   197
 * \enum SDL_TextureModulate
slouken@1985
   198
 *
slouken@1985
   199
 * \brief The texture channel modulation used in SDL_RenderCopy()
slouken@1985
   200
 */
slouken@1985
   201
typedef enum
slouken@1985
   202
{
slouken@1985
   203
    SDL_TEXTUREMODULATE_NONE = 0x00000000,     /**< No modulation */
slouken@1985
   204
    SDL_TEXTUREMODULATE_COLOR = 0x00000001,    /**< srcC = srcC * color */
slouken@2208
   205
    SDL_TEXTUREMODULATE_ALPHA = 0x00000002     /**< srcA = srcA * alpha */
slouken@1985
   206
} SDL_TextureModulate;
slouken@1985
   207
slouken@1985
   208
/**
slouken@2884
   209
 * \enum SDL_BlendMode
slouken@1895
   210
 *
slouken@2884
   211
 * \brief The blend mode used in SDL_RenderCopy() and drawing operations
slouken@1895
   212
 */
slouken@1895
   213
typedef enum
slouken@1895
   214
{
slouken@2884
   215
    SDL_BLENDMODE_NONE = 0x00000000,     /**< No blending */
slouken@2884
   216
    SDL_BLENDMODE_MASK = 0x00000001,     /**< dst = A ? src : dst (alpha is mask) */
slouken@2884
   217
    SDL_BLENDMODE_BLEND = 0x00000002,    /**< dst = (src * A) + (dst * (1-A)) */
slouken@2884
   218
    SDL_BLENDMODE_ADD = 0x00000004,      /**< dst = (src * A) + dst */
slouken@2884
   219
    SDL_BLENDMODE_MOD = 0x00000008       /**< dst = src * dst */
slouken@2884
   220
} SDL_BlendMode;
slouken@1895
   221
slouken@1895
   222
/**
slouken@1895
   223
 * \enum SDL_TextureScaleMode
slouken@1895
   224
 *
slouken@1985
   225
 * \brief The texture scale mode used in SDL_RenderCopy()
slouken@1895
   226
 */
slouken@1895
   227
typedef enum
slouken@1895
   228
{
slouken@1965
   229
    SDL_TEXTURESCALEMODE_NONE = 0x00000000,     /**< No scaling, rectangles must match dimensions */
slouken@1965
   230
    SDL_TEXTURESCALEMODE_FAST = 0x00000001,     /**< Point sampling or equivalent algorithm */
slouken@1965
   231
    SDL_TEXTURESCALEMODE_SLOW = 0x00000002,     /**< Linear filtering or equivalent algorithm */
slouken@2208
   232
    SDL_TEXTURESCALEMODE_BEST = 0x00000004      /**< Bicubic filtering or equivalent algorithm */
slouken@1895
   233
} SDL_TextureScaleMode;
slouken@1895
   234
slouken@1895
   235
/**
slouken@1895
   236
 * \typedef SDL_TextureID
slouken@1895
   237
 *
slouken@1895
   238
 * \brief An efficient driver-specific representation of pixel data
slouken@1895
   239
 */
slouken@1895
   240
typedef Uint32 SDL_TextureID;
slouken@1895
   241
slouken@1895
   242
/**
slouken@1895
   243
 * \typedef SDL_GLContext
slouken@1895
   244
 *
slouken@1895
   245
 * \brief An opaque handle to an OpenGL context.
slouken@1895
   246
 */
slouken@1895
   247
typedef void *SDL_GLContext;
slouken@1895
   248
slouken@1895
   249
/**
slouken@1895
   250
 * \enum SDL_GLattr
slouken@1895
   251
 *
slouken@1895
   252
 * \brief OpenGL configuration attributes
slouken@0
   253
 */
slouken@1895
   254
typedef enum
slouken@1895
   255
{
slouken@0
   256
    SDL_GL_RED_SIZE,
slouken@0
   257
    SDL_GL_GREEN_SIZE,
slouken@0
   258
    SDL_GL_BLUE_SIZE,
slouken@0
   259
    SDL_GL_ALPHA_SIZE,
slouken@0
   260
    SDL_GL_BUFFER_SIZE,
slouken@0
   261
    SDL_GL_DOUBLEBUFFER,
slouken@0
   262
    SDL_GL_DEPTH_SIZE,
slouken@0
   263
    SDL_GL_STENCIL_SIZE,
slouken@0
   264
    SDL_GL_ACCUM_RED_SIZE,
slouken@0
   265
    SDL_GL_ACCUM_GREEN_SIZE,
slouken@0
   266
    SDL_GL_ACCUM_BLUE_SIZE,
slouken@450
   267
    SDL_GL_ACCUM_ALPHA_SIZE,
slouken@655
   268
    SDL_GL_STEREO,
slouken@656
   269
    SDL_GL_MULTISAMPLEBUFFERS,
slouken@1736
   270
    SDL_GL_MULTISAMPLESAMPLES,
hfutrell@2747
   271
    SDL_GL_ACCELERATED_VISUAL,
hfutrell@2747
   272
    SDL_GL_RETAINED_BACKING
slouken@0
   273
} SDL_GLattr;
slouken@0
   274
slouken@0
   275
slouken@0
   276
/* Function prototypes */
slouken@0
   277
slouken@1895
   278
/**
slouken@1895
   279
 * \fn int SDL_GetNumVideoDrivers(void)
slouken@0
   280
 *
slouken@1895
   281
 * \brief Get the number of video drivers compiled into SDL
slouken@0
   282
 *
slouken@1895
   283
 * \sa SDL_GetVideoDriver()
slouken@0
   284
 */
slouken@1895
   285
extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void);
slouken@1895
   286
slouken@1895
   287
/**
slouken@1895
   288
 * \fn const char *SDL_GetVideoDriver(int index)
slouken@1895
   289
 *
slouken@1895
   290
 * \brief Get the name of a built in video driver.
slouken@1895
   291
 *
slouken@1895
   292
 * \note The video drivers are presented in the order in which they are
slouken@1895
   293
 * normally checked during initialization.
slouken@1895
   294
 *
slouken@1895
   295
 * \sa SDL_GetNumVideoDrivers()
slouken@1895
   296
 */
slouken@1895
   297
extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index);
slouken@1895
   298
slouken@1895
   299
/**
slouken@1895
   300
 * \fn int SDL_VideoInit(const char *driver_name, Uint32 flags)
slouken@1895
   301
 *
slouken@1895
   302
 * \brief Initialize the video subsystem, optionally specifying a video driver.
slouken@1895
   303
 *
slouken@1895
   304
 * \param driver_name Initialize a specific driver by name, or NULL for the default video driver.
slouken@1895
   305
 * \param flags FIXME: Still needed?
slouken@1895
   306
 *
slouken@1895
   307
 * \return 0 on success, -1 on error
slouken@1895
   308
 *
slouken@1895
   309
 * This function initializes the video subsystem; setting up a connection
slouken@1895
   310
 * to the window manager, etc, and determines the available display modes
slouken@1895
   311
 * and pixel formats, but does not initialize a window or graphics mode.
slouken@1895
   312
 *
slouken@1895
   313
 * \sa SDL_VideoQuit()
slouken@1895
   314
 */
slouken@1895
   315
extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name,
slouken@1895
   316
                                          Uint32 flags);
slouken@1895
   317
slouken@1895
   318
/**
slouken@1895
   319
 * \fn void SDL_VideoQuit(void)
slouken@1895
   320
 *
slouken@1895
   321
 * \brief Shuts down the video subsystem.
slouken@1895
   322
 *
slouken@1895
   323
 * This function closes all windows, and restores the original video mode.
slouken@1895
   324
 *
slouken@1895
   325
 * \sa SDL_VideoInit()
slouken@1895
   326
 */
slouken@337
   327
extern DECLSPEC void SDLCALL SDL_VideoQuit(void);
slouken@0
   328
slouken@1895
   329
/**
slouken@1895
   330
 * \fn const char *SDL_GetCurrentVideoDriver(void)
slouken@1895
   331
 *
slouken@1895
   332
 * \brief Returns the name of the currently initialized video driver.
slouken@1895
   333
 *
slouken@1895
   334
 * \return The name of the current video driver or NULL if no driver
slouken@1895
   335
 *         has been initialized
slouken@1895
   336
 *
slouken@1895
   337
 * \sa SDL_GetNumVideoDrivers()
slouken@1895
   338
 * \sa SDL_GetVideoDriver()
slouken@0
   339
 */
slouken@1895
   340
extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void);
slouken@0
   341
slouken@1895
   342
/**
slouken@1895
   343
 * \fn int SDL_GetNumVideoDisplays(void)
slouken@1895
   344
 *
slouken@1895
   345
 * \brief Returns the number of available video displays.
slouken@1895
   346
 *
slouken@1895
   347
 * \sa SDL_SelectVideoDisplay()
slouken@0
   348
 */
slouken@1895
   349
extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void);
slouken@0
   350
slouken@1895
   351
/**
slouken@1895
   352
 * \fn int SDL_SelectVideoDisplay(int index)
slouken@1895
   353
 *
slouken@1895
   354
 * \brief Set the index of the currently selected display.
slouken@1895
   355
 *
slouken@1963
   356
 * \return 0 on success, or -1 if the index is out of range.
slouken@1963
   357
 *
slouken@1963
   358
 * \sa SDL_GetNumVideoDisplays()
slouken@1963
   359
 * \sa SDL_GetCurrentVideoDisplay()
slouken@1963
   360
 */
slouken@1963
   361
extern DECLSPEC int SDLCALL SDL_SelectVideoDisplay(int index);
slouken@1963
   362
slouken@1963
   363
/**
slouken@1963
   364
 * \fn int SDL_GetCurrentVideoDisplay(void)
slouken@1963
   365
 *
slouken@1963
   366
 * \brief Get the index of the currently selected display.
slouken@1963
   367
 *
slouken@1895
   368
 * \return The index of the currently selected display.
slouken@1895
   369
 *
slouken@1895
   370
 * \sa SDL_GetNumVideoDisplays()
slouken@1963
   371
 * \sa SDL_SelectVideoDisplay()
slouken@0
   372
 */
slouken@1963
   373
extern DECLSPEC int SDLCALL SDL_GetCurrentVideoDisplay(void);
slouken@0
   374
slouken@1895
   375
/**
slouken@1895
   376
 * \fn int SDL_GetNumDisplayModes(void)
slouken@0
   377
 *
slouken@1895
   378
 * \brief Returns the number of available display modes for the current display.
slouken@1895
   379
 *
slouken@1895
   380
 * \sa SDL_GetDisplayMode()
slouken@0
   381
 */
slouken@1895
   382
extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(void);
slouken@0
   383
slouken@1895
   384
/**
slouken@1967
   385
 * \fn int SDL_GetDisplayMode(int index, SDL_DisplayMode *mode)
slouken@0
   386
 *
slouken@1968
   387
 * \brief Fill in information about a specific display mode.
slouken@1895
   388
 *
slouken@1895
   389
 * \note The display modes are sorted in this priority:
slouken@1895
   390
 *       \li bits per pixel -> more colors to fewer colors
slouken@1895
   391
 *       \li width -> largest to smallest
slouken@1895
   392
 *       \li height -> largest to smallest
slouken@1895
   393
 *       \li refresh rate -> highest to lowest
slouken@1895
   394
 *
slouken@1895
   395
 * \sa SDL_GetNumDisplayModes()
slouken@0
   396
 */
slouken@1967
   397
extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int index,
slouken@1967
   398
                                               SDL_DisplayMode * mode);
slouken@0
   399
slouken@1895
   400
/**
slouken@1967
   401
 * \fn int SDL_GetDesktopDisplayMode(SDL_DisplayMode *mode)
slouken@0
   402
 *
slouken@1968
   403
 * \brief Fill in information about the desktop display mode for the current display.
slouken@1895
   404
 */
slouken@1967
   405
extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(SDL_DisplayMode * mode);
slouken@1895
   406
slouken@1895
   407
/**
slouken@1967
   408
 * \fn int SDL_GetCurrentDisplayMode(SDL_DisplayMode *mode)
slouken@0
   409
 *
slouken@1968
   410
 * \brief Fill in information about the current display mode.
slouken@1895
   411
 */
slouken@1967
   412
extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(SDL_DisplayMode * mode);
slouken@1895
   413
slouken@1895
   414
/**
slouken@1895
   415
 * \fn SDL_DisplayMode *SDL_GetClosestDisplayMode(const SDL_DisplayMode *mode, SDL_DisplayMode *closest)
slouken@0
   416
 *
slouken@1895
   417
 * \brief Get the closest match to the requested display mode.
slouken@0
   418
 *
slouken@1895
   419
 * \param mode The desired display mode
slouken@1895
   420
 * \param closest A pointer to a display mode to be filled in with the closest match of the available display modes.
slouken@0
   421
 *
slouken@1895
   422
 * \return The passed in value 'closest', or NULL if no matching video mode was available.
slouken@0
   423
 *
slouken@1895
   424
 * The available display modes are scanned, and 'closest' is filled in with the closest mode matching the requested mode and returned.  The mode format and refresh_rate default to the desktop mode if they are 0.  The modes are scanned with size being first priority, format being second priority, and finally checking the refresh_rate.  If all the available modes are too small, then NULL is returned.
slouken@0
   425
 *
slouken@1895
   426
 * \sa SDL_GetNumDisplayModes()
slouken@1895
   427
 * \sa SDL_GetDisplayMode()
slouken@1895
   428
 */
slouken@1895
   429
extern DECLSPEC SDL_DisplayMode *SDLCALL SDL_GetClosestDisplayMode(const
slouken@1895
   430
                                                                   SDL_DisplayMode
slouken@1895
   431
                                                                   * mode,
slouken@1895
   432
                                                                   SDL_DisplayMode
slouken@1895
   433
                                                                   * closest);
slouken@1895
   434
slouken@1895
   435
/**
slouken@1895
   436
 * \fn int SDL_SetFullscreenDisplayMode(const SDL_DisplayMode *mode)
slouken@0
   437
 *
slouken@1895
   438
 * \brief Set the display mode used when a fullscreen window is visible
slouken@1895
   439
 *        on the currently selected display.
slouken@0
   440
 *
slouken@1895
   441
 * \param mode The mode to use, or NULL for the desktop mode.
slouken@0
   442
 *
slouken@1895
   443
 * \return 0 on success, or -1 if setting the display mode failed.
slouken@0
   444
 *
slouken@1895
   445
 * \sa SDL_SetWindowFullscreen()
slouken@0
   446
 */
slouken@1895
   447
extern DECLSPEC int SDLCALL SDL_SetFullscreenDisplayMode(const SDL_DisplayMode
slouken@1895
   448
                                                         * mode);
slouken@0
   449
slouken@1895
   450
/**
slouken@1967
   451
 * \fn int SDL_GetFullscreenDisplayMode(SDL_DisplayMode *mode)
slouken@1895
   452
 *
slouken@1968
   453
 * \brief Fill in information about the display mode used when a fullscreen
slouken@1968
   454
 *        window is visible on the currently selected display.
slouken@0
   455
 */
slouken@1967
   456
extern DECLSPEC int SDLCALL SDL_GetFullscreenDisplayMode(SDL_DisplayMode *
slouken@1967
   457
                                                         mode);
slouken@0
   458
slouken@1895
   459
/**
slouken@1895
   460
 * \fn int SDL_SetDisplayPalette(const SDL_Color *colors, int firstcolor, int ncolors)
slouken@1895
   461
 *
slouken@1895
   462
 * \brief Set the palette entries for indexed display modes.
slouken@1895
   463
 *
slouken@1895
   464
 * \return 0 on success, or -1 if the display mode isn't palettized or the colors couldn't be set.
slouken@0
   465
 */
slouken@1895
   466
extern DECLSPEC int SDLCALL SDL_SetDisplayPalette(const SDL_Color * colors,
slouken@1895
   467
                                                  int firstcolor,
slouken@1895
   468
                                                  int ncolors);
slouken@0
   469
slouken@1895
   470
/**
slouken@1895
   471
 * \fn int SDL_GetDisplayPalette(SDL_Color *colors, int firstcolor, int ncolors)
slouken@1895
   472
 *
slouken@1895
   473
 * \brief Gets the palette entries for indexed display modes.
slouken@1895
   474
 *
slouken@1895
   475
 * \return 0 on success, or -1 if the display mode isn't palettized
slouken@1895
   476
 */
slouken@1895
   477
extern DECLSPEC int SDLCALL SDL_GetDisplayPalette(SDL_Color * colors,
slouken@1895
   478
                                                  int firstcolor,
slouken@1895
   479
                                                  int ncolors);
slouken@1895
   480
slouken@1895
   481
/**
slouken@1895
   482
 * \fn int SDL_SetGamma(float red, float green, float blue)
slouken@1895
   483
 *
slouken@1895
   484
 * \brief Set the gamma correction for each of the color channels on the currently selected display.
slouken@1895
   485
 *
slouken@1895
   486
 * \return 0 on success, or -1 if setting the gamma isn't supported.
slouken@1895
   487
 *
slouken@1895
   488
 * \sa SDL_SetGammaRamp()
slouken@0
   489
 */
slouken@337
   490
extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue);
slouken@0
   491
slouken@1895
   492
/**
slouken@1895
   493
 * \fn int SDL_SetGammaRamp(const Uint16 * red, const Uint16 * green, const Uint16 * blue)
slouken@1895
   494
 *
slouken@1895
   495
 * \brief Set the gamma ramp for the currently selected display.
slouken@1895
   496
 *
slouken@1895
   497
 * \param red The translation table for the red channel, or NULL
slouken@1895
   498
 * \param green The translation table for the green channel, or NULL
slouken@1895
   499
 * \param blue The translation table for the blue channel, or NULL
slouken@1895
   500
 *
slouken@1895
   501
 * \return 0 on success, or -1 if gamma ramps are unsupported.
slouken@1895
   502
 *
slouken@0
   503
 * Set the gamma translation table for the red, green, and blue channels
slouken@0
   504
 * of the video hardware.  Each table is an array of 256 16-bit quantities,
slouken@0
   505
 * representing a mapping between the input and output for that channel.
slouken@0
   506
 * The input is the index into the array, and the output is the 16-bit
slouken@0
   507
 * gamma value at that index, scaled to the output color precision.
slouken@0
   508
 * 
slouken@1895
   509
 * \sa SDL_GetGammaRamp()
slouken@0
   510
 */
slouken@1895
   511
extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 * red,
slouken@1895
   512
                                             const Uint16 * green,
slouken@1895
   513
                                             const Uint16 * blue);
slouken@0
   514
slouken@1895
   515
/**
slouken@1895
   516
 * \fn int SDL_GetGammaRamp(Uint16 * red, Uint16 * green, Uint16 * blue)
slouken@1895
   517
 *
slouken@1895
   518
 * \brief Get the gamma ramp for the currently selected display.
slouken@1895
   519
 *
slouken@1895
   520
 * \param red A pointer to a 256 element array of 16-bit quantities to hold the translation table for the red channel, or NULL.
slouken@1895
   521
 * \param green A pointer to a 256 element array of 16-bit quantities to hold the translation table for the green channel, or NULL.
slouken@1895
   522
 * \param blue A pointer to a 256 element array of 16-bit quantities to hold the translation table for the blue channel, or NULL.
slouken@0
   523
 * 
slouken@1895
   524
 * \return 0 on success, or -1 if gamma ramps are unsupported.
slouken@1895
   525
 *
slouken@1895
   526
 * \sa SDL_SetGammaRamp()
slouken@0
   527
 */
slouken@1895
   528
extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 * red, Uint16 * green,
slouken@1895
   529
                                             Uint16 * blue);
slouken@0
   530
slouken@1895
   531
slouken@1895
   532
/**
slouken@1895
   533
 * \fn SDL_WindowID SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
slouken@0
   534
 *
slouken@1895
   535
 * \brief Create a window with the specified position, dimensions, and flags.
slouken@1895
   536
 *
slouken@1956
   537
 * \param title The title of the window, in UTF-8 encoding
slouken@1956
   538
 * \param x The x position of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED
slouken@1956
   539
 * \param y The y position of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED
slouken@1895
   540
 * \param w The width of the window
slouken@1895
   541
 * \param h The height of the window
slouken@1895
   542
 * \param flags The flags for the window, a mask of any of the following: SDL_WINDOW_FULLSCREEN, SDL_WINDOW_OPENGL, SDL_WINDOW_SHOWN, SDL_WINDOW_BORDERLESS, SDL_WINDOW_RESIZABLE, SDL_WINDOW_MAXIMIZED, SDL_WINDOW_MINIMIZED, SDL_WINDOW_INPUT_GRABBED
slouken@1895
   543
 *
slouken@1895
   544
 * \return The id of the window created, or zero if window creation failed.
slouken@1895
   545
 *
slouken@1895
   546
 * \sa SDL_DestroyWindow()
slouken@0
   547
 */
slouken@1895
   548
extern DECLSPEC SDL_WindowID SDLCALL SDL_CreateWindow(const char *title,
slouken@1895
   549
                                                      int x, int y, int w,
slouken@1895
   550
                                                      int h, Uint32 flags);
slouken@0
   551
slouken@1895
   552
/**
slouken@1895
   553
 * \fn SDL_WindowID SDL_CreateWindowFrom(void *data)
slouken@0
   554
 *
slouken@1895
   555
 * \brief Create an SDL window struct from an existing native window.
slouken@0
   556
 *
slouken@1895
   557
 * \param data A pointer to driver-dependent window creation data
slouken@1895
   558
 *
slouken@1895
   559
 * \return The id of the window created, or zero if window creation failed.
slouken@1895
   560
 *
slouken@1895
   561
 * \warning This function is NOT SUPPORTED, use at your own risk!
slouken@1895
   562
 *
slouken@1895
   563
 * \sa SDL_DestroyWindow()
slouken@0
   564
 */
slouken@1895
   565
extern DECLSPEC SDL_WindowID SDLCALL SDL_CreateWindowFrom(const void *data);
slouken@1895
   566
slouken@1895
   567
/**
slouken@1895
   568
 * \fn Uint32 SDL_GetWindowFlags(SDL_WindowID windowID)
slouken@1895
   569
 *
slouken@1895
   570
 * \brief Get the window flags.
slouken@1895
   571
 */
slouken@1895
   572
extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_WindowID windowID);
slouken@1895
   573
slouken@1895
   574
/**
slouken@1895
   575
 * \fn void SDL_SetWindowTitle(SDL_WindowID windowID, const char *title)
slouken@1895
   576
 *
slouken@1895
   577
 * \brief Set the title of the window, in UTF-8 format.
slouken@1895
   578
 *
slouken@1895
   579
 * \sa SDL_GetWindowTitle()
slouken@1895
   580
 */
slouken@1895
   581
extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_WindowID windowID,
slouken@1895
   582
                                                const char *title);
slouken@1895
   583
slouken@1895
   584
/**
slouken@1895
   585
 * \fn const char *SDL_GetWindowTitle(SDL_WindowID windowID)
slouken@1895
   586
 *
slouken@1895
   587
 * \brief Get the title of the window, in UTF-8 format.
slouken@1895
   588
 *
slouken@1895
   589
 * \sa SDL_SetWindowTitle()
slouken@1895
   590
 */
slouken@1895
   591
extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_WindowID windowID);
slouken@1895
   592
slouken@1895
   593
/**
slouken@2967
   594
 * \fn void SDL_SetWindowIcon(SDL_WindowID windowID, SDL_Surface *icon)
slouken@1895
   595
 *
slouken@1895
   596
 * \brief Set the icon of the window.
slouken@1895
   597
 *
slouken@1895
   598
 * \param icon The icon for the window
slouken@1895
   599
 */
slouken@2967
   600
extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_WindowID windowID, SDL_Surface * icon);
slouken@1895
   601
slouken@1895
   602
/**
slouken@1895
   603
 * \fn void SDL_SetWindowData(SDL_WindowID windowID, void *userdata)
slouken@1895
   604
 *
slouken@1895
   605
 * \brief Associate an arbitrary pointer with the window.
slouken@1895
   606
 *
slouken@1895
   607
 * \sa SDL_GetWindowData()
slouken@1895
   608
 */
slouken@1895
   609
extern DECLSPEC void SDLCALL SDL_SetWindowData(SDL_WindowID windowID,
slouken@1895
   610
                                               void *userdata);
slouken@1895
   611
slouken@1895
   612
/**
slouken@1895
   613
 * \fn void *SDL_GetWindowData(SDL_WindowID windowID)
slouken@1895
   614
 *
slouken@1895
   615
 * \brief Retrieve the data pointer associated with the window.
slouken@1895
   616
 *
slouken@1895
   617
 * \sa SDL_SetWindowData()
slouken@1895
   618
 */
slouken@1895
   619
extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_WindowID windowID);
slouken@1895
   620
slouken@1895
   621
/**
slouken@1895
   622
 * \fn void SDL_SetWindowPosition(SDL_WindowID windowID, int x, int y)
slouken@1895
   623
 *
slouken@1895
   624
 * \brief Set the position of the window.
slouken@1895
   625
 *
slouken@1895
   626
 * \param windowID The window to reposition
slouken@1895
   627
 * \param x The x coordinate of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED
slouken@1895
   628
 * \param y The y coordinate of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED
slouken@1895
   629
 *
slouken@1895
   630
 * \note The window coordinate origin is the upper left of the display.
slouken@1895
   631
 *
slouken@1895
   632
 * \sa SDL_GetWindowPosition()
slouken@1895
   633
 */
slouken@1895
   634
extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_WindowID windowID,
slouken@1895
   635
                                                   int x, int y);
slouken@1895
   636
slouken@1895
   637
/**
slouken@1895
   638
 * \fn void SDL_GetWindowPosition(SDL_WindowID windowID, int *x, int *y)
slouken@1895
   639
 *
slouken@1895
   640
 * \brief Get the position of the window.
slouken@1895
   641
 *
slouken@1895
   642
 * \sa SDL_SetWindowPosition()
slouken@1895
   643
 */
slouken@1895
   644
extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_WindowID windowID,
slouken@1895
   645
                                                   int *x, int *y);
slouken@1895
   646
slouken@1895
   647
/**
slouken@1895
   648
 * \fn void SDL_SetWindowSize(SDL_WindowID windowID, int w, int w)
slouken@1895
   649
 *
slouken@1895
   650
 * \brief Set the size of the window's client area.
slouken@1895
   651
 *
slouken@1895
   652
 * \note You can't change the size of a fullscreen window, it automatically
slouken@1895
   653
 * matches the size of the display mode.
slouken@1895
   654
 *
slouken@1895
   655
 * \sa SDL_GetWindowSize()
slouken@1895
   656
 */
slouken@1895
   657
extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_WindowID windowID, int w,
slouken@1895
   658
                                               int h);
slouken@1895
   659
slouken@1895
   660
/**
slouken@2907
   661
 * \fn void SDL_GetWindowSize(SDL_WindowID windowID, int *w, int *h)
slouken@1895
   662
 *
slouken@1895
   663
 * \brief Get the size of the window's client area.
slouken@1895
   664
 *
slouken@1895
   665
 * \sa SDL_SetWindowSize()
slouken@1895
   666
 */
slouken@1895
   667
extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_WindowID windowID, int *w,
slouken@1895
   668
                                               int *h);
slouken@1895
   669
slouken@1895
   670
/**
slouken@1895
   671
 * \fn void SDL_ShowWindow(SDL_WindowID windowID)
slouken@1895
   672
 *
slouken@1895
   673
 * \brief Show the window
slouken@1895
   674
 *
slouken@1895
   675
 * \sa SDL_HideWindow()
slouken@1895
   676
 */
slouken@1895
   677
extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_WindowID windowID);
slouken@1895
   678
slouken@1895
   679
/**
slouken@1895
   680
 * \fn void SDL_HideWindow(SDL_WindowID windowID)
slouken@1895
   681
 *
slouken@1895
   682
 * \brief Hide the window
slouken@1895
   683
 *
slouken@1895
   684
 * \sa SDL_ShowWindow()
slouken@1895
   685
 */
slouken@1895
   686
extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_WindowID windowID);
slouken@1895
   687
slouken@1895
   688
/**
slouken@1895
   689
 * \fn void SDL_RaiseWindow(SDL_WindowID windowID)
slouken@1895
   690
 *
slouken@1895
   691
 * \brief Raise the window above other windows and set the input focus.
slouken@1895
   692
 */
slouken@1895
   693
extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_WindowID windowID);
slouken@1895
   694
slouken@1895
   695
/**
slouken@1895
   696
 * \fn void SDL_MaximizeWindow(SDL_WindowID windowID)
slouken@1895
   697
 *
slouken@1895
   698
 * \brief Make the window as large as possible.
slouken@1895
   699
 *
slouken@1895
   700
 * \sa SDL_RestoreWindow()
slouken@1895
   701
 */
slouken@1895
   702
extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_WindowID windowID);
slouken@1895
   703
slouken@1895
   704
/**
slouken@1895
   705
 * \fn void SDL_MinimizeWindow(SDL_WindowID windowID)
slouken@1895
   706
 *
slouken@1895
   707
 * \brief Minimize the window to an iconic representation.
slouken@1895
   708
 *
slouken@1895
   709
 * \sa SDL_RestoreWindow()
slouken@1895
   710
 */
slouken@1895
   711
extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_WindowID windowID);
slouken@1895
   712
slouken@1895
   713
/**
slouken@1895
   714
 * \fn void SDL_RestoreWindow(SDL_WindowID windowID)
slouken@1895
   715
 *
slouken@1895
   716
 * \brief Restore the size and position of a minimized or maximized window.
slouken@1895
   717
 *
slouken@1895
   718
 * \sa SDL_MaximizeWindow()
slouken@1895
   719
 * \sa SDL_MinimizeWindow()
slouken@1895
   720
 */
slouken@1895
   721
extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_WindowID windowID);
slouken@1895
   722
slouken@1895
   723
/**
slouken@1895
   724
 * \fn int SDL_SetWindowFullscreen(SDL_WindowID windowID, int fullscreen)
slouken@1895
   725
 *
slouken@1895
   726
 * \brief Set the window's fullscreen state.
slouken@1895
   727
 *
slouken@1895
   728
 * \return 0 on success, or -1 if setting the display mode failed.
slouken@1895
   729
 *
slouken@1895
   730
 * \sa SDL_SetFullscreenDisplayMode()
slouken@1895
   731
 */
slouken@1895
   732
extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_WindowID windowID,
slouken@1895
   733
                                                    int fullscreen);
slouken@1895
   734
slouken@1895
   735
/**
slouken@1895
   736
 * \fn void SDL_SetWindowGrab(SDL_WindowID windowID, int mode)
slouken@1895
   737
 *
slouken@1895
   738
 * \brief Set the window's input grab mode.
slouken@1895
   739
 *
slouken@1895
   740
 * \param mode This is 1 to grab input, and 0 to release input.
slouken@1895
   741
 *
slouken@1895
   742
 * \sa SDL_GetWindowGrab()
slouken@1895
   743
 */
slouken@1895
   744
extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_WindowID windowID,
slouken@1895
   745
                                               int mode);
slouken@1895
   746
slouken@1895
   747
/**
slouken@1895
   748
 * \fn int SDL_GetWindowGrab(SDL_WindowID windowID)
slouken@1895
   749
 *
slouken@1895
   750
 * \brief Get the window's input grab mode.
slouken@1895
   751
 *
slouken@1895
   752
 * \return This returns 1 if input is grabbed, and 0 otherwise.
slouken@1895
   753
 *
slouken@1895
   754
 * \sa SDL_SetWindowGrab()
slouken@1895
   755
 */
slouken@1895
   756
extern DECLSPEC int SDLCALL SDL_GetWindowGrab(SDL_WindowID windowID);
slouken@1895
   757
slouken@1895
   758
/**
slouken@1895
   759
 * \fn SDL_bool SDL_GetWindowWMInfo(SDL_WindowID windowID, struct SDL_SysWMinfo * info)
slouken@1895
   760
 *
slouken@1895
   761
 * \brief Get driver specific information about a window.
slouken@1895
   762
 *
slouken@1895
   763
 * \note Include SDL_syswm.h for the declaration of SDL_SysWMinfo.
slouken@1895
   764
 */
slouken@1895
   765
struct SDL_SysWMinfo;
slouken@1895
   766
extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_WindowID windowID,
slouken@1895
   767
                                                     struct SDL_SysWMinfo
slouken@1895
   768
                                                     *info);
slouken@1895
   769
slouken@1895
   770
/**
slouken@1895
   771
 * \fn void SDL_DestroyWindow(SDL_WindowID windowID)
slouken@1895
   772
 *
slouken@1895
   773
 * \brief Destroy a window.
slouken@1895
   774
 */
slouken@1895
   775
extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_WindowID windowID);
slouken@1895
   776
slouken@1895
   777
/**
slouken@1969
   778
 * \fn int SDL_GetNumRenderDrivers(void)
slouken@1895
   779
 *
slouken@1969
   780
 * \brief Get the number of 2D rendering drivers available for the current display.
slouken@1895
   781
 *
slouken@1969
   782
 * A render driver is a set of code that handles rendering and texture
slouken@1895
   783
 * management on a particular display.  Normally there is only one, but
slouken@1895
   784
 * some drivers may have several available with different capabilities.
slouken@1895
   785
 *
slouken@1969
   786
 * \sa SDL_GetRenderDriverInfo()
slouken@1895
   787
 * \sa SDL_CreateRenderer()
slouken@1895
   788
 */
slouken@1969
   789
extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
slouken@1895
   790
slouken@1895
   791
/**
slouken@1969
   792
 * \fn int SDL_GetRenderDriverInfo(int index, SDL_RendererInfo *info)
slouken@1895
   793
 *
slouken@1969
   794
 * \brief Get information about a specific 2D rendering driver for the current display.
slouken@1895
   795
 *
slouken@1969
   796
 * \param index The index of the driver to query information about.
slouken@1969
   797
 * \param info A pointer to an SDL_RendererInfo struct to be filled with information on the rendering driver.
slouken@1907
   798
 *
slouken@1907
   799
 * \return 0 on success, -1 if the index was out of range
slouken@1907
   800
 *
slouken@1895
   801
 * \sa SDL_CreateRenderer()
slouken@1895
   802
 */
slouken@1969
   803
extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index,
slouken@1969
   804
                                                    SDL_RendererInfo * info);
slouken@1895
   805
slouken@1895
   806
/**
slouken@1895
   807
 * \fn int SDL_CreateRenderer(SDL_WindowID window, int index, Uint32 flags)
slouken@1895
   808
 *
slouken@1895
   809
 * \brief Create and make active a 2D rendering context for a window.
slouken@1895
   810
 *
slouken@1895
   811
 * \param windowID The window used for rendering
slouken@1969
   812
 * \param index The index of the rendering driver to initialize, or -1 to initialize the first one supporting the requested flags.
slouken@1895
   813
 * \param flags SDL_RendererFlags
slouken@1895
   814
 *
slouken@1895
   815
 * \return 0 on success, -1 if the flags were not supported, or -2 if
slouken@1895
   816
 *         there isn't enough memory to support the requested flags
slouken@1895
   817
 *
slouken@1895
   818
 * \sa SDL_SelectRenderer()
slouken@1969
   819
 * \sa SDL_GetRendererInfo()
slouken@1895
   820
 * \sa SDL_DestroyRenderer()
slouken@1895
   821
 */
slouken@1895
   822
extern DECLSPEC int SDLCALL SDL_CreateRenderer(SDL_WindowID windowID,
slouken@1895
   823
                                               int index, Uint32 flags);
slouken@1895
   824
slouken@1895
   825
/**
slouken@1895
   826
 * \fn int SDL_SelectRenderer(SDL_WindowID windowID)
slouken@1895
   827
 *
slouken@1895
   828
 * \brief Select the rendering context for a particular window.
slouken@1895
   829
 *
slouken@1895
   830
 * \return 0 on success, -1 if the selected window doesn't have a
slouken@1895
   831
 *         rendering context.
slouken@1895
   832
 */
slouken@1895
   833
extern DECLSPEC int SDLCALL SDL_SelectRenderer(SDL_WindowID windowID);
slouken@1895
   834
slouken@1895
   835
/**
slouken@1969
   836
 * \fn int SDL_GetRendererInfo(SDL_RendererInfo *info)
slouken@1969
   837
 *
slouken@1969
   838
 * \brief Get information about the current rendering context.
slouken@1969
   839
 */
slouken@1969
   840
extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_RendererInfo * info);
slouken@1969
   841
slouken@1969
   842
/**
slouken@1895
   843
 * \fn SDL_TextureID SDL_CreateTexture(Uint32 format, int access, int w, int h)
slouken@1895
   844
 *
slouken@1895
   845
 * \brief Create a texture for the current rendering context.
slouken@1895
   846
 *
slouken@1895
   847
 * \param format The format of the texture
slouken@1895
   848
 * \param access One of the enumerated values in SDL_TextureAccess
slouken@1895
   849
 * \param w The width of the texture in pixels
slouken@1895
   850
 * \param h The height of the texture in pixels
slouken@1895
   851
 *
slouken@1969
   852
 * \return The created texture is returned, or 0 if no rendering context was active,  the format was unsupported, or the width or height were out of range.
slouken@1895
   853
 *
slouken@1895
   854
 * \sa SDL_QueryTexture()
slouken@1895
   855
 * \sa SDL_DestroyTexture()
slouken@1895
   856
 */
slouken@1895
   857
extern DECLSPEC SDL_TextureID SDLCALL SDL_CreateTexture(Uint32 format,
slouken@1895
   858
                                                        int access, int w,
slouken@1895
   859
                                                        int h);
slouken@1895
   860
slouken@1895
   861
/**
slouken@2222
   862
 * \fn SDL_TextureID SDL_CreateTextureFromSurface(Uint32 format, SDL_Surface *surface)
slouken@1895
   863
 *
slouken@1895
   864
 * \brief Create a texture from an existing surface.
slouken@1895
   865
 *
slouken@1895
   866
 * \param format The format of the texture, or 0 to pick an appropriate format
slouken@1895
   867
 * \param surface The surface containing pixel data used to fill the texture
slouken@1895
   868
 *
slouken@1969
   869
 * \return The created texture is returned, or 0 if no rendering context was active,  the format was unsupported, or the surface width or height were out of range.
slouken@1895
   870
 *
slouken@1895
   871
 * \note The surface is not modified or freed by this function.
slouken@1895
   872
 *
slouken@1895
   873
 * \sa SDL_QueryTexture()
slouken@1895
   874
 * \sa SDL_DestroyTexture()
slouken@1895
   875
 */
slouken@1895
   876
extern DECLSPEC SDL_TextureID SDLCALL SDL_CreateTextureFromSurface(Uint32
slouken@1895
   877
                                                                   format,
slouken@1895
   878
                                                                   SDL_Surface
slouken@1895
   879
                                                                   * surface);
slouken@1895
   880
slouken@1895
   881
/**
slouken@1895
   882
 * \fn int SDL_QueryTexture(SDL_TextureID textureID, Uint32 *format, int *access, int *w, int *h)
slouken@1895
   883
 *
slouken@1895
   884
 * \brief Query the attributes of a texture
slouken@1895
   885
 *
slouken@1895
   886
 * \param texture A texture to be queried
slouken@1895
   887
 * \param format A pointer filled in with the raw format of the texture.  The actual format may differ, but pixel transfers will use this format.
slouken@1895
   888
 * \param access A pointer filled in with the actual access to the texture.
slouken@1895
   889
 * \param w A pointer filled in with the width of the texture in pixels
slouken@1895
   890
 * \param h A pointer filled in with the height of the texture in pixels
slouken@1895
   891
 *
slouken@1895
   892
 * \return 0 on success, or -1 if the texture is not valid
slouken@1895
   893
 */
slouken@1895
   894
extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_TextureID textureID,
slouken@1895
   895
                                             Uint32 * format, int *access,
slouken@1895
   896
                                             int *w, int *h);
slouken@1895
   897
slouken@1895
   898
/**
slouken@1895
   899
 * \fn int SDL_QueryTexturePixels(SDL_TextureID textureID, void **pixels, int pitch)
slouken@1895
   900
 *
slouken@1895
   901
 * \brief Query the pixels of a texture, if the texture does not need to be locked for pixel access.
slouken@1895
   902
 *
slouken@2222
   903
 * \param texture A texture to be queried, which was created with SDL_TEXTUREACCESS_STREAMING
slouken@1895
   904
 * \param pixels A pointer filled with a pointer to the pixels for the texture 
slouken@1895
   905
 * \param pitch A pointer filled in with the pitch of the pixel data
slouken@1895
   906
 *
slouken@1895
   907
 * \return 0 on success, or -1 if the texture is not valid, or must be locked for pixel access.
slouken@1895
   908
 */
slouken@1895
   909
extern DECLSPEC int SDLCALL SDL_QueryTexturePixels(SDL_TextureID textureID,
slouken@1895
   910
                                                   void **pixels, int *pitch);
slouken@1895
   911
slouken@1895
   912
/**
slouken@1895
   913
 * \fn int SDL_SetTexturePalette(SDL_TextureID textureID, const SDL_Color * colors, int firstcolor, int ncolors)
slouken@1895
   914
 *
slouken@1895
   915
 * \brief Update an indexed texture with a color palette
slouken@1895
   916
 *
slouken@1895
   917
 * \param texture The texture to update
slouken@1895
   918
 * \param colors The array of RGB color data
slouken@1895
   919
 * \param firstcolor The first index to update
slouken@1895
   920
 * \param ncolors The number of palette entries to fill with the color data
slouken@1895
   921
 *
slouken@1895
   922
 * \return 0 on success, or -1 if the texture is not valid or not an indexed texture
slouken@1895
   923
 */
slouken@1895
   924
extern DECLSPEC int SDLCALL SDL_SetTexturePalette(SDL_TextureID textureID,
slouken@1895
   925
                                                  const SDL_Color * colors,
slouken@1895
   926
                                                  int firstcolor,
slouken@1895
   927
                                                  int ncolors);
slouken@1895
   928
slouken@1895
   929
/**
slouken@1895
   930
 * \fn int SDL_GetTexturePalette(SDL_TextureID textureID, SDL_Color * colors, int firstcolor, int ncolors)
slouken@1895
   931
 *
slouken@1895
   932
 * \brief Update an indexed texture with a color palette
slouken@1895
   933
 *
slouken@1895
   934
 * \param texture The texture to update
slouken@1895
   935
 * \param colors The array to fill with RGB color data
slouken@1895
   936
 * \param firstcolor The first index to retrieve
slouken@1895
   937
 * \param ncolors The number of palette entries to retrieve
slouken@1895
   938
 *
slouken@1895
   939
 * \return 0 on success, or -1 if the texture is not valid or not an indexed texture
slouken@1895
   940
 */
slouken@1895
   941
extern DECLSPEC int SDLCALL SDL_GetTexturePalette(SDL_TextureID textureID,
slouken@1895
   942
                                                  SDL_Color * colors,
slouken@1895
   943
                                                  int firstcolor,
slouken@1895
   944
                                                  int ncolors);
slouken@1895
   945
slouken@1895
   946
/**
slouken@1985
   947
 * \fn int SDL_SetTextureColorMod(SDL_TextureID textureID, Uint8 r, Uint8 g, Uint8 b)
slouken@1985
   948
 *
slouken@1985
   949
 * \brief Set an additional color value used in render copy operations
slouken@1985
   950
 *
slouken@1985
   951
 * \param texture The texture to update
slouken@1985
   952
 * \param r The red source color value multiplied into copy operations
slouken@1985
   953
 * \param g The green source color value multiplied into copy operations
slouken@1985
   954
 * \param b The blue source color value multiplied into copy operations
slouken@1985
   955
 *
slouken@1985
   956
 * \return 0 on success, or -1 if the texture is not valid or color modulation is not supported
slouken@1985
   957
 *
slouken@1985
   958
 * \sa SDL_GetTextureColorMod()
slouken@1985
   959
 */
slouken@1985
   960
extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_TextureID textureID,
slouken@1985
   961
                                                   Uint8 r, Uint8 g, Uint8 b);
slouken@1985
   962
slouken@1985
   963
slouken@1985
   964
/**
slouken@1985
   965
 * \fn int SDL_GetTextureColorMod(SDL_TextureID textureID, Uint8 *r, Uint8 *g, Uint8 *b)
slouken@1985
   966
 *
slouken@1985
   967
 * \brief Get the additional color value used in render copy operations
slouken@1985
   968
 *
slouken@1985
   969
 * \param texture The texture to query
slouken@1985
   970
 * \param r A pointer filled in with the source red color value
slouken@1985
   971
 * \param g A pointer filled in with the source green color value
slouken@1985
   972
 * \param b A pointer filled in with the source blue color value
slouken@1985
   973
 *
slouken@1985
   974
 * \return 0 on success, or -1 if the texture is not valid
slouken@1985
   975
 *
slouken@1985
   976
 * \sa SDL_SetTextureColorMod()
slouken@1985
   977
 */
slouken@1985
   978
extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_TextureID textureID,
slouken@1985
   979
                                                   Uint8 * r, Uint8 * g,
slouken@1985
   980
                                                   Uint8 * b);
slouken@1985
   981
slouken@1985
   982
/**
slouken@1985
   983
 * \fn int SDL_SetTextureAlphaMod(SDL_TextureID textureID, Uint8 alpha)
slouken@1985
   984
 *
slouken@1985
   985
 * \brief Set an additional alpha value used in render copy operations
slouken@1985
   986
 *
slouken@1985
   987
 * \param texture The texture to update
slouken@1985
   988
 * \param alpha The source alpha value multiplied into copy operations.
slouken@1985
   989
 *
slouken@1985
   990
 * \return 0 on success, or -1 if the texture is not valid or alpha modulation is not supported
slouken@1985
   991
 *
slouken@1985
   992
 * \sa SDL_GetTextureAlphaMod()
slouken@1985
   993
 */
slouken@1985
   994
extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_TextureID textureID,
slouken@1985
   995
                                                   Uint8 alpha);
slouken@1985
   996
slouken@1985
   997
/**
slouken@1985
   998
 * \fn int SDL_GetTextureAlphaMod(SDL_TextureID textureID, Uint8 *alpha)
slouken@1985
   999
 *
slouken@1985
  1000
 * \brief Get the additional alpha value used in render copy operations
slouken@1985
  1001
 *
slouken@1985
  1002
 * \param texture The texture to query
slouken@1985
  1003
 * \param alpha A pointer filled in with the source alpha value
slouken@1985
  1004
 *
slouken@1985
  1005
 * \return 0 on success, or -1 if the texture is not valid
slouken@1985
  1006
 *
slouken@1985
  1007
 * \sa SDL_SetTextureAlphaMod()
slouken@1985
  1008
 */
slouken@1985
  1009
extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_TextureID textureID,
slouken@1985
  1010
                                                   Uint8 * alpha);
slouken@1985
  1011
slouken@1985
  1012
/**
slouken@1985
  1013
 * \fn int SDL_SetTextureBlendMode(SDL_TextureID textureID, int blendMode)
slouken@1985
  1014
 *
slouken@1985
  1015
 * \brief Set the blend mode used for texture copy operations
slouken@1985
  1016
 *
slouken@1985
  1017
 * \param texture The texture to update
slouken@1985
  1018
 * \param blendMode SDL_TextureBlendMode to use for texture blending
slouken@1985
  1019
 *
slouken@1985
  1020
 * \return 0 on success, or -1 if the texture is not valid or the blend mode is not supported
slouken@1985
  1021
 *
slouken@1985
  1022
 * \note If the blend mode is not supported, the closest supported mode is chosen.
slouken@1985
  1023
 *
slouken@1985
  1024
 * \sa SDL_GetTextureBlendMode()
slouken@1985
  1025
 */
slouken@1985
  1026
extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_TextureID textureID,
slouken@1985
  1027
                                                    int blendMode);
slouken@1985
  1028
slouken@1985
  1029
/**
slouken@1985
  1030
 * \fn int SDL_GetTextureBlendMode(SDL_TextureID textureID, int *blendMode)
slouken@1985
  1031
 *
slouken@1985
  1032
 * \brief Get the blend mode used for texture copy operations
slouken@1985
  1033
 *
slouken@1985
  1034
 * \param texture The texture to query
slouken@1985
  1035
 * \param blendMode A pointer filled in with the current blend mode
slouken@1985
  1036
 *
slouken@1985
  1037
 * \return 0 on success, or -1 if the texture is not valid
slouken@1985
  1038
 *
slouken@1985
  1039
 * \sa SDL_SetTextureBlendMode()
slouken@1985
  1040
 */
slouken@1985
  1041
extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_TextureID textureID,
slouken@1985
  1042
                                                    int *blendMode);
slouken@1985
  1043
slouken@1985
  1044
/**
slouken@1985
  1045
 * \fn int SDL_SetTextureScaleMode(SDL_TextureID textureID, int scaleMode)
slouken@1985
  1046
 *
slouken@1985
  1047
 * \brief Set the scale mode used for texture copy operations
slouken@1985
  1048
 *
slouken@1985
  1049
 * \param texture The texture to update
slouken@1985
  1050
 * \param scaleMode SDL_TextureScaleMode to use for texture scaling
slouken@1985
  1051
 *
slouken@1985
  1052
 * \return 0 on success, or -1 if the texture is not valid or the scale mode is not supported
slouken@1985
  1053
 *
slouken@1985
  1054
 * \note If the scale mode is not supported, the closest supported mode is chosen.
slouken@1985
  1055
 *
slouken@1985
  1056
 * \sa SDL_GetTextureScaleMode()
slouken@1985
  1057
 */
slouken@1985
  1058
extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_TextureID textureID,
slouken@1985
  1059
                                                    int scaleMode);
slouken@1985
  1060
slouken@1985
  1061
/**
slouken@1985
  1062
 * \fn int SDL_GetTextureScaleMode(SDL_TextureID textureID, int *scaleMode)
slouken@1985
  1063
 *
slouken@1985
  1064
 * \brief Get the scale mode used for texture copy operations
slouken@1985
  1065
 *
slouken@1985
  1066
 * \param texture The texture to query
slouken@1985
  1067
 * \param scaleMode A pointer filled in with the current scale mode
slouken@1985
  1068
 *
slouken@1985
  1069
 * \return 0 on success, or -1 if the texture is not valid
slouken@1985
  1070
 *
slouken@1985
  1071
 * \sa SDL_SetTextureScaleMode()
slouken@1985
  1072
 */
slouken@1985
  1073
extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_TextureID textureID,
slouken@1985
  1074
                                                    int *scaleMode);
slouken@1985
  1075
slouken@1985
  1076
/**
slouken@1895
  1077
 * \fn int SDL_UpdateTexture(SDL_TextureID textureID, const SDL_Rect *rect, const void *pixels, int pitch)
slouken@1895
  1078
 *
slouken@1895
  1079
 * \brief Update the given texture rectangle with new pixel data.
slouken@1895
  1080
 *
slouken@1895
  1081
 * \param texture The texture to update
slouken@1895
  1082
 * \param rect A pointer to the rectangle of pixels to update, or NULL to update the entire texture.
slouken@1895
  1083
 * \param pixels The raw pixel data
slouken@1895
  1084
 * \param pitch The number of bytes between rows of pixel data
slouken@1895
  1085
 *
slouken@1895
  1086
 * \return 0 on success, or -1 if the texture is not valid
slouken@1895
  1087
 *
slouken@2222
  1088
 * \note This is a fairly slow function.
slouken@1895
  1089
 */
slouken@1895
  1090
extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_TextureID textureID,
slouken@1895
  1091
                                              const SDL_Rect * rect,
slouken@1895
  1092
                                              const void *pixels, int pitch);
slouken@1895
  1093
slouken@1895
  1094
/**
slouken@1895
  1095
 * \fn void SDL_LockTexture(SDL_TextureID textureID, const SDL_Rect *rect, int markDirty, void **pixels, int *pitch)
slouken@1895
  1096
 *
slouken@1895
  1097
 * \brief Lock a portion of the texture for pixel access.
slouken@1895
  1098
 *
slouken@2222
  1099
 * \param textureID The texture to lock for access, which was created with SDL_TEXTUREACCESS_STREAMING.
slouken@1895
  1100
 * \param rect A pointer to the rectangle to lock for access. If the rect is NULL, the entire texture will be locked.
slouken@1895
  1101
 * \param markDirty If this is nonzero, the locked area will be marked dirty when the texture is unlocked.
slouken@1895
  1102
 * \param pixels This is filled in with a pointer to the locked pixels, appropriately offset by the locked area.
slouken@1895
  1103
 * \param pitch This is filled in with the pitch of the locked pixels.
slouken@1895
  1104
 *
slouken@2222
  1105
 * \return 0 on success, or -1 if the texture is not valid or was created with SDL_TEXTUREACCESS_STATIC
slouken@1895
  1106
 *
slouken@1895
  1107
 * \sa SDL_DirtyTexture()
slouken@1895
  1108
 * \sa SDL_UnlockTexture()
slouken@1895
  1109
 */
slouken@1895
  1110
extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_TextureID textureID,
slouken@1895
  1111
                                            const SDL_Rect * rect,
slouken@1895
  1112
                                            int markDirty, void **pixels,
slouken@1895
  1113
                                            int *pitch);
slouken@1895
  1114
slouken@1895
  1115
/**
slouken@1895
  1116
 * \fn void SDL_UnlockTexture(SDL_TextureID textureID)
slouken@1895
  1117
 *
slouken@1895
  1118
 * \brief Unlock a texture, uploading the changes to video memory, if needed.
slouken@1895
  1119
 *
slouken@1895
  1120
 * \sa SDL_LockTexture()
slouken@1895
  1121
 * \sa SDL_DirtyTexture()
slouken@1895
  1122
 */
slouken@1895
  1123
extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_TextureID textureID);
slouken@1895
  1124
slouken@1895
  1125
/**
slouken@1895
  1126
 * \fn void SDL_DirtyTexture(SDL_TextureID textureID, int numrects, const SDL_Rect * rects)
slouken@1895
  1127
 *
slouken@1895
  1128
 * \brief Mark the specified rectangles of the texture as dirty.
slouken@1895
  1129
 *
slouken@2222
  1130
 * \param textureID The texture to mark dirty, which was created with SDL_TEXTUREACCESS_STREAMING.
slouken@2222
  1131
 * \param numrects The number of rectangles pointed to by rects.
slouken@2222
  1132
 * \param rects The pointer to an array of dirty rectangles.
slouken@1895
  1133
 *
slouken@1895
  1134
 * \sa SDL_LockTexture()
slouken@1895
  1135
 * \sa SDL_UnlockTexture()
slouken@1895
  1136
 */
slouken@1895
  1137
extern DECLSPEC void SDLCALL SDL_DirtyTexture(SDL_TextureID textureID,
slouken@1895
  1138
                                              int numrects,
slouken@1895
  1139
                                              const SDL_Rect * rects);
slouken@1895
  1140
slouken@1895
  1141
/**
slouken@2884
  1142
 * \fn void SDL_SetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a)
slouken@1895
  1143
 *
slouken@2884
  1144
 * \brief Set the color used for drawing operations (Fill and Line).
slouken@2884
  1145
 *
slouken@2884
  1146
 * \param r The red value used to draw on the rendering target
slouken@2884
  1147
 * \param g The green value used to draw on the rendering target
slouken@2884
  1148
 * \param b The blue value used to draw on the rendering target
slouken@2884
  1149
 * \param a The alpha value used to draw on the rendering target, usually SDL_ALPHA_OPAQUE (255)
slouken@2884
  1150
 * \return 0 on success, or -1 if there is no rendering context current
slouken@2884
  1151
 */
slouken@2884
  1152
extern DECLSPEC int SDL_SetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b,
slouken@2884
  1153
                                           Uint8 a);
slouken@2884
  1154
slouken@2884
  1155
/**
slouken@2884
  1156
 * \fn void SDL_GetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a)
slouken@2884
  1157
 *
slouken@2884
  1158
 * \brief Get the color used for drawing operations (Fill and Line).
slouken@2884
  1159
 *
slouken@2884
  1160
 * \param r A pointer to the red value used to draw on the rendering target
slouken@2884
  1161
 * \param g A pointer to the green value used to draw on the rendering target
slouken@2884
  1162
 * \param b A pointer to the blue value used to draw on the rendering target
slouken@2884
  1163
 * \param a A pointer to the alpha value used to draw on the rendering target, usually SDL_ALPHA_OPAQUE (255)
slouken@2884
  1164
 * \return 0 on success, or -1 if there is no rendering context current
slouken@2884
  1165
 */
slouken@2884
  1166
extern DECLSPEC int SDL_GetRenderDrawColor(Uint8 * r, Uint8 * g, Uint8 * b,
slouken@2884
  1167
                                           Uint8 * a);
slouken@2884
  1168
slouken@2884
  1169
/**
slouken@2884
  1170
 * \fn int SDL_SetRenderDrawBlendMode(int blendMode)
slouken@2884
  1171
 *
slouken@2886
  1172
 * \brief Set the blend mode used for drawing operations (Fill and Line).
slouken@2884
  1173
 *
slouken@2884
  1174
 * \param blendMode SDL_BlendMode to use for blending
slouken@2884
  1175
 *
slouken@2884
  1176
 * \return 0 on success, or -1 if there is no rendering context current
slouken@2884
  1177
 *
slouken@2884
  1178
 * \note If the blend mode is not supported, the closest supported mode is chosen.
slouken@2884
  1179
 *
slouken@2884
  1180
 * \sa SDL_SetRenderDrawBlendMode()
slouken@2884
  1181
 */
slouken@2884
  1182
extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(int blendMode);
slouken@2884
  1183
slouken@2884
  1184
/**
slouken@2884
  1185
 * \fn int SDL_GetRenderDrawBlendMode(int *blendMode)
slouken@2884
  1186
 *
slouken@2884
  1187
 * \brief Get the blend mode used for drawing operations
slouken@2884
  1188
 *
slouken@2884
  1189
 * \param blendMode A pointer filled in with the current blend mode
slouken@2884
  1190
 *
slouken@2884
  1191
 * \return 0 on success, or -1 if there is no rendering context current
slouken@2884
  1192
 *
slouken@2884
  1193
 * \sa SDL_SetRenderDrawBlendMode()
slouken@2884
  1194
 */
slouken@2884
  1195
extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(int *blendMode);
slouken@2884
  1196
slouken@2884
  1197
/**
slouken@2901
  1198
 * \fn int SDL_RenderPoint(int x, int y)
slouken@2901
  1199
 *
slouken@2901
  1200
 * \brief Draw a point on the current rendering target.
slouken@2901
  1201
 *
slouken@2901
  1202
 * \param x The x coordinate of the point
slouken@2901
  1203
 * \param y The y coordinate of the point
slouken@2901
  1204
 *
slouken@2901
  1205
 * \return 0 on success, or -1 if there is no rendering context current
slouken@2901
  1206
 */
slouken@2901
  1207
extern DECLSPEC int SDLCALL SDL_RenderPoint(int x, int y);
slouken@2901
  1208
slouken@2901
  1209
/**
slouken@2886
  1210
 * \fn int SDL_RenderLine(int x1, int y1, int x2, int y2)
slouken@2884
  1211
 *
slouken@2884
  1212
 * \brief Draw a line on the current rendering target.
slouken@2884
  1213
 *
slouken@2884
  1214
 * \param x1 The x coordinate of the start point
slouken@2884
  1215
 * \param y1 The y coordinate of the start point
slouken@2884
  1216
 * \param x2 The x coordinate of the end point
slouken@2884
  1217
 * \param y2 The y coordinate of the end point
slouken@2884
  1218
 *
slouken@2884
  1219
 * \return 0 on success, or -1 if there is no rendering context current
slouken@2884
  1220
 */
slouken@2884
  1221
extern DECLSPEC int SDLCALL SDL_RenderLine(int x1, int y1, int x2, int y2);
slouken@2884
  1222
slouken@2884
  1223
/**
slouken@2884
  1224
 * \fn void SDL_RenderFill(const SDL_Rect *rect)
slouken@2884
  1225
 *
slouken@2884
  1226
 * \brief Fill the current rendering target with the drawing color.
slouken@1895
  1227
 *
slouken@1985
  1228
 * \param r The red value used to fill the rendering target
slouken@1985
  1229
 * \param g The green value used to fill the rendering target
slouken@1985
  1230
 * \param b The blue value used to fill the rendering target
slouken@1985
  1231
 * \param a The alpha value used to fill the rendering target, usually SDL_ALPHA_OPAQUE (255)
slouken@1895
  1232
 * \param rect A pointer to the destination rectangle, or NULL for the entire rendering target.
slouken@1895
  1233
 *
slouken@1969
  1234
 * \return 0 on success, or -1 if there is no rendering context current
slouken@1895
  1235
 */
slouken@2884
  1236
extern DECLSPEC int SDLCALL SDL_RenderFill(const SDL_Rect * rect);
slouken@1895
  1237
slouken@1895
  1238
/**
slouken@1985
  1239
 * \fn int SDL_RenderCopy(SDL_TextureID textureID, const SDL_Rect *srcrect, const SDL_Rect *dstrect)
slouken@1895
  1240
 *
slouken@1895
  1241
 * \brief Copy a portion of the texture to the current rendering target.
slouken@1895
  1242
 *
slouken@1895
  1243
 * \param texture The source texture.
slouken@1895
  1244
 * \param srcrect A pointer to the source rectangle, or NULL for the entire texture.
slouken@1895
  1245
 * \param dstrect A pointer to the destination rectangle, or NULL for the entire rendering target.
slouken@1895
  1246
 *
slouken@1969
  1247
 * \return 0 on success, or -1 if there is no rendering context current, or the driver doesn't support the requested operation.
slouken@1895
  1248
 */
slouken@1895
  1249
extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_TextureID textureID,
slouken@1895
  1250
                                           const SDL_Rect * srcrect,
slouken@1985
  1251
                                           const SDL_Rect * dstrect);
slouken@1895
  1252
slouken@1895
  1253
/**
slouken@1895
  1254
 * \fn int SDL_RenderReadPixels(const SDL_Rect *rect, void *pixels, int pitch)
slouken@1895
  1255
 *
slouken@1895
  1256
 * \brief Read pixels from the current rendering target.
slouken@1895
  1257
 *
slouken@1895
  1258
 * \param rect A pointer to the rectangle to read, or NULL for the entire render target
slouken@1895
  1259
 * \param pixels A pointer to be filled in with the pixel data
slouken@1895
  1260
 * \param pitch The pitch of the pixels parameter
slouken@1895
  1261
 *
slouken@1895
  1262
 * \return 0 on success, or -1 if pixel reading is not supported.
slouken@1895
  1263
 *
slouken@1895
  1264
 * \warning This is a very slow operation, and should not be used frequently.
slouken@1895
  1265
 */
slouken@1895
  1266
extern DECLSPEC int SDLCALL SDL_RenderReadPixels(const SDL_Rect * rect,
slouken@1895
  1267
                                                 void *pixels, int pitch);
slouken@1895
  1268
slouken@1895
  1269
/**
slouken@1895
  1270
 * \fn int SDL_RenderWritePixels(const SDL_Rect *rect, const void *pixels, int pitch)
slouken@1895
  1271
 *
slouken@1895
  1272
 * \brief Write pixels to the current rendering target.
slouken@1895
  1273
 *
slouken@1895
  1274
 * \param rect A pointer to the rectangle to write, or NULL for the entire render target
slouken@1895
  1275
 * \param pixels A pointer to the pixel data to write
slouken@1895
  1276
 * \param pitch The pitch of the pixels parameter
slouken@1895
  1277
 *
slouken@1895
  1278
 * \return 0 on success, or -1 if pixel writing is not supported.
slouken@1895
  1279
 *
slouken@1895
  1280
 * \warning This is a very slow operation, and should not be used frequently.
slouken@1895
  1281
 */
slouken@1895
  1282
extern DECLSPEC int SDLCALL SDL_RenderWritePixels(const SDL_Rect * rect,
slouken@1895
  1283
                                                  const void *pixels,
slouken@1895
  1284
                                                  int pitch);
slouken@1895
  1285
slouken@1895
  1286
/**
slouken@1895
  1287
 * \fn void SDL_RenderPresent(void)
slouken@1895
  1288
 *
slouken@1895
  1289
 * \brief Update the screen with rendering performed.
slouken@1895
  1290
 */
slouken@1895
  1291
extern DECLSPEC void SDLCALL SDL_RenderPresent(void);
slouken@1895
  1292
slouken@1895
  1293
/**
slouken@1895
  1294
 * \fn void SDL_DestroyTexture(SDL_TextureID textureID);
slouken@1895
  1295
 *
slouken@1895
  1296
 * \brief Destroy the specified texture.
slouken@1895
  1297
 *
slouken@1895
  1298
 * \sa SDL_CreateTexture()
slouken@1895
  1299
 * \sa SDL_CreateTextureFromSurface()
slouken@1895
  1300
 */
slouken@1895
  1301
extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_TextureID textureID);
slouken@1895
  1302
slouken@1895
  1303
/**
slouken@1895
  1304
 * \fn void SDL_DestroyRenderer(SDL_WindowID windowID);
slouken@1895
  1305
 *
slouken@1895
  1306
 * \brief Destroy the rendering context for a window and free associated
slouken@1895
  1307
 *        textures.
slouken@1895
  1308
 *
slouken@1895
  1309
 * \sa SDL_CreateRenderer()
slouken@1895
  1310
 */
slouken@1895
  1311
extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_WindowID windowID);
slouken@0
  1312
slouken@0
  1313
slouken@0
  1314
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
slouken@0
  1315
/* OpenGL support functions.                                                 */
slouken@0
  1316
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
slouken@0
  1317
slouken@1895
  1318
/**
slouken@1895
  1319
 * \fn int SDL_GL_LoadLibrary(const char *path)
slouken@0
  1320
 *
slouken@1895
  1321
 * \brief Dynamically load an OpenGL library.
slouken@1895
  1322
 *
slouken@1895
  1323
 * \param path The platform dependent OpenGL library name, or NULL to open the default OpenGL library
slouken@1895
  1324
 *
slouken@1895
  1325
 * \return 0 on success, or -1 if the library couldn't be loaded
slouken@1895
  1326
 *
slouken@1936
  1327
 * This should be done after initializing the video driver, but before
slouken@1936
  1328
 * creating any OpenGL windows.  If no OpenGL library is loaded, the default
slouken@1936
  1329
 * library will be loaded upon creation of the first OpenGL window.
slouken@1936
  1330
 *
slouken@1895
  1331
 * \note If you do this, you need to retrieve all of the GL functions used in
slouken@1895
  1332
 *       your program from the dynamic library using SDL_GL_GetProcAddress().
slouken@1895
  1333
 *
slouken@1895
  1334
 * \sa SDL_GL_GetProcAddress()
slouken@0
  1335
 */
slouken@337
  1336
extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
slouken@0
  1337
slouken@1895
  1338
/**
slouken@1895
  1339
 * \fn void *SDL_GL_GetProcAddress(const char *proc)
slouken@1895
  1340
 *
slouken@1895
  1341
 * \brief Get the address of an OpenGL function.
slouken@0
  1342
 */
slouken@1895
  1343
extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc);
slouken@0
  1344
slouken@1895
  1345
/**
slouken@1926
  1346
 * \fn SDL_bool SDL_GL_ExtensionSupported(const char *extension)
slouken@1926
  1347
 *
slouken@1926
  1348
 * \brief Return true if an OpenGL extension is supported for the current context.
slouken@1926
  1349
 */
slouken@1926
  1350
extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char
slouken@1926
  1351
                                                           *extension);
slouken@1926
  1352
slouken@1926
  1353
/**
slouken@1895
  1354
 * \fn int SDL_GL_SetAttribute(SDL_GLattr attr, int value)
slouken@1895
  1355
 *
slouken@1895
  1356
 * \brief Set an OpenGL window attribute before window creation.
slouken@0
  1357
 */
slouken@337
  1358
extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
slouken@0
  1359
slouken@1895
  1360
/**
slouken@1895
  1361
 * \fn int SDL_GL_GetWindowAttribute(SDL_WindowID windowID, SDL_GLattr attr, int *value)
slouken@0
  1362
 *
slouken@1936
  1363
 * \brief Get the actual value for an attribute from the current context.
slouken@0
  1364
 */
slouken@1936
  1365
extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value);
slouken@0
  1366
slouken@1895
  1367
/**
slouken@1895
  1368
 * \fn SDL_GLContext SDL_GL_CreateContext(SDL_WindowID windowID)
slouken@1895
  1369
 *
slouken@1895
  1370
 * \brief Create an OpenGL context for use with an OpenGL window, and make it current.
slouken@1895
  1371
 *
slouken@1895
  1372
 * \sa SDL_GL_DeleteContext()
slouken@1895
  1373
 */
slouken@1895
  1374
extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_WindowID
slouken@1895
  1375
                                                           windowID);
slouken@1895
  1376
slouken@1895
  1377
/**
slouken@1895
  1378
 * \fn int SDL_GL_MakeCurrent(SDL_WindowID windowID, SDL_GLContext context)
slouken@1895
  1379
 *
slouken@1895
  1380
 * \brief Set up an OpenGL context for rendering into an OpenGL window.
slouken@1895
  1381
 *
slouken@1895
  1382
 * \note The context must have been created with a compatible window.
slouken@1895
  1383
 */
slouken@1895
  1384
extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_WindowID windowID,
slouken@1895
  1385
                                               SDL_GLContext context);
slouken@1895
  1386
slouken@1895
  1387
/**
slouken@1895
  1388
 * \fn int SDL_GL_SetSwapInterval(int interval)
slouken@1895
  1389
 *
slouken@1895
  1390
 * \brief Set the swap interval for the current OpenGL context.
slouken@1895
  1391
 *
slouken@1912
  1392
 * \param interval 0 for immediate updates, 1 for updates synchronized with the vertical retrace
slouken@1912
  1393
 *
slouken@1912
  1394
 * \return 0 on success, or -1 if setting the swap interval is not supported.
slouken@1912
  1395
 *
slouken@1895
  1396
 * \sa SDL_GL_GetSwapInterval()
slouken@1895
  1397
 */
slouken@1895
  1398
extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval);
slouken@1895
  1399
slouken@1895
  1400
/**
slouken@1895
  1401
 * \fn int SDL_GL_GetSwapInterval(void)
slouken@1895
  1402
 *
slouken@1895
  1403
 * \brief Get the swap interval for the current OpenGL context.
slouken@1895
  1404
 *
slouken@1912
  1405
 * \return 0 if there is no vertical retrace synchronization, 1 if the buffer swap is synchronized with the vertical retrace, and -1 if getting the swap interval is not supported.
slouken@1912
  1406
 *
slouken@1895
  1407
 * \sa SDL_GL_SetSwapInterval()
slouken@1895
  1408
 */
slouken@1895
  1409
extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void);
slouken@1895
  1410
slouken@1895
  1411
/**
slouken@1912
  1412
 * \fn void SDL_GL_SwapWindow(SDL_WindowID windowID)
slouken@1895
  1413
 *
slouken@1912
  1414
 * \brief Swap the OpenGL buffers for the window, if double-buffering is supported.
slouken@0
  1415
 */
slouken@1912
  1416
extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_WindowID windowID);
slouken@0
  1417
slouken@1895
  1418
/**
slouken@1895
  1419
 * \fn void SDL_GL_DeleteContext(SDL_GLContext context)
slouken@1895
  1420
 *
slouken@1895
  1421
 * \brief Delete an OpenGL context.
slouken@1895
  1422
 *
slouken@1895
  1423
 * \sa SDL_GL_CreateContext()
slouken@0
  1424
 */
slouken@1895
  1425
extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context);
slouken@0
  1426
slouken@0
  1427
slouken@0
  1428
/* Ends C function definitions when using C++ */
slouken@0
  1429
#ifdef __cplusplus
slouken@1895
  1430
/* *INDENT-OFF* */
slouken@0
  1431
}
slouken@1895
  1432
/* *INDENT-ON* */
slouken@0
  1433
#endif
slouken@0
  1434
#include "close_code.h"
slouken@0
  1435
slouken@0
  1436
#endif /* _SDL_video_h */
slouken@1895
  1437
slouken@1895
  1438
/* vi: set ts=4 sw=4 expandtab: */