include/SDL_video.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 21 Dec 2008 17:39:41 +0000
changeset 2901 133601e3b255
parent 2886 633ce79b7a5b
child 2907 5f89d3751ce7
permissions -rw-r--r--
Added RenderPiont() API
Merged the drawing tests into a single test program
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@1895
   594
 * \fn void SDL_SetWindowIcon(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@1895
   600
 * FIXME: The icon needs to be set before the window is first shown.  Should some icon representation be part of the window creation data?
slouken@1895
   601
 */
slouken@1895
   602
extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_Surface * icon);
slouken@1895
   603
slouken@1895
   604
/**
slouken@1895
   605
 * \fn void SDL_SetWindowData(SDL_WindowID windowID, void *userdata)
slouken@1895
   606
 *
slouken@1895
   607
 * \brief Associate an arbitrary pointer with the window.
slouken@1895
   608
 *
slouken@1895
   609
 * \sa SDL_GetWindowData()
slouken@1895
   610
 */
slouken@1895
   611
extern DECLSPEC void SDLCALL SDL_SetWindowData(SDL_WindowID windowID,
slouken@1895
   612
                                               void *userdata);
slouken@1895
   613
slouken@1895
   614
/**
slouken@1895
   615
 * \fn void *SDL_GetWindowData(SDL_WindowID windowID)
slouken@1895
   616
 *
slouken@1895
   617
 * \brief Retrieve the data pointer associated with the window.
slouken@1895
   618
 *
slouken@1895
   619
 * \sa SDL_SetWindowData()
slouken@1895
   620
 */
slouken@1895
   621
extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_WindowID windowID);
slouken@1895
   622
slouken@1895
   623
/**
slouken@1895
   624
 * \fn void SDL_SetWindowPosition(SDL_WindowID windowID, int x, int y)
slouken@1895
   625
 *
slouken@1895
   626
 * \brief Set the position of the window.
slouken@1895
   627
 *
slouken@1895
   628
 * \param windowID The window to reposition
slouken@1895
   629
 * \param x The x coordinate of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED
slouken@1895
   630
 * \param y The y coordinate of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED
slouken@1895
   631
 *
slouken@1895
   632
 * \note The window coordinate origin is the upper left of the display.
slouken@1895
   633
 *
slouken@1895
   634
 * \sa SDL_GetWindowPosition()
slouken@1895
   635
 */
slouken@1895
   636
extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_WindowID windowID,
slouken@1895
   637
                                                   int x, int y);
slouken@1895
   638
slouken@1895
   639
/**
slouken@1895
   640
 * \fn void SDL_GetWindowPosition(SDL_WindowID windowID, int *x, int *y)
slouken@1895
   641
 *
slouken@1895
   642
 * \brief Get the position of the window.
slouken@1895
   643
 *
slouken@1895
   644
 * \sa SDL_SetWindowPosition()
slouken@1895
   645
 */
slouken@1895
   646
extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_WindowID windowID,
slouken@1895
   647
                                                   int *x, int *y);
slouken@1895
   648
slouken@1895
   649
/**
slouken@1895
   650
 * \fn void SDL_SetWindowSize(SDL_WindowID windowID, int w, int w)
slouken@1895
   651
 *
slouken@1895
   652
 * \brief Set the size of the window's client area.
slouken@1895
   653
 *
slouken@1895
   654
 * \note You can't change the size of a fullscreen window, it automatically
slouken@1895
   655
 * matches the size of the display mode.
slouken@1895
   656
 *
slouken@1895
   657
 * \sa SDL_GetWindowSize()
slouken@1895
   658
 */
slouken@1895
   659
extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_WindowID windowID, int w,
slouken@1895
   660
                                               int h);
slouken@1895
   661
slouken@1895
   662
/**
slouken@1895
   663
 * \fn void SDL_GetWindowSize(SDL_WindowID windowID, int *w, int *w)
slouken@1895
   664
 *
slouken@1895
   665
 * \brief Get the size of the window's client area.
slouken@1895
   666
 *
slouken@1895
   667
 * \sa SDL_SetWindowSize()
slouken@1895
   668
 */
slouken@1895
   669
extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_WindowID windowID, int *w,
slouken@1895
   670
                                               int *h);
slouken@1895
   671
slouken@1895
   672
/**
slouken@1895
   673
 * \fn void SDL_ShowWindow(SDL_WindowID windowID)
slouken@1895
   674
 *
slouken@1895
   675
 * \brief Show the window
slouken@1895
   676
 *
slouken@1895
   677
 * \sa SDL_HideWindow()
slouken@1895
   678
 */
slouken@1895
   679
extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_WindowID windowID);
slouken@1895
   680
slouken@1895
   681
/**
slouken@1895
   682
 * \fn void SDL_HideWindow(SDL_WindowID windowID)
slouken@1895
   683
 *
slouken@1895
   684
 * \brief Hide the window
slouken@1895
   685
 *
slouken@1895
   686
 * \sa SDL_ShowWindow()
slouken@1895
   687
 */
slouken@1895
   688
extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_WindowID windowID);
slouken@1895
   689
slouken@1895
   690
/**
slouken@1895
   691
 * \fn void SDL_RaiseWindow(SDL_WindowID windowID)
slouken@1895
   692
 *
slouken@1895
   693
 * \brief Raise the window above other windows and set the input focus.
slouken@1895
   694
 */
slouken@1895
   695
extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_WindowID windowID);
slouken@1895
   696
slouken@1895
   697
/**
slouken@1895
   698
 * \fn void SDL_MaximizeWindow(SDL_WindowID windowID)
slouken@1895
   699
 *
slouken@1895
   700
 * \brief Make the window as large as possible.
slouken@1895
   701
 *
slouken@1895
   702
 * \sa SDL_RestoreWindow()
slouken@1895
   703
 */
slouken@1895
   704
extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_WindowID windowID);
slouken@1895
   705
slouken@1895
   706
/**
slouken@1895
   707
 * \fn void SDL_MinimizeWindow(SDL_WindowID windowID)
slouken@1895
   708
 *
slouken@1895
   709
 * \brief Minimize the window to an iconic representation.
slouken@1895
   710
 *
slouken@1895
   711
 * \sa SDL_RestoreWindow()
slouken@1895
   712
 */
slouken@1895
   713
extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_WindowID windowID);
slouken@1895
   714
slouken@1895
   715
/**
slouken@1895
   716
 * \fn void SDL_RestoreWindow(SDL_WindowID windowID)
slouken@1895
   717
 *
slouken@1895
   718
 * \brief Restore the size and position of a minimized or maximized window.
slouken@1895
   719
 *
slouken@1895
   720
 * \sa SDL_MaximizeWindow()
slouken@1895
   721
 * \sa SDL_MinimizeWindow()
slouken@1895
   722
 */
slouken@1895
   723
extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_WindowID windowID);
slouken@1895
   724
slouken@1895
   725
/**
slouken@1895
   726
 * \fn int SDL_SetWindowFullscreen(SDL_WindowID windowID, int fullscreen)
slouken@1895
   727
 *
slouken@1895
   728
 * \brief Set the window's fullscreen state.
slouken@1895
   729
 *
slouken@1895
   730
 * \return 0 on success, or -1 if setting the display mode failed.
slouken@1895
   731
 *
slouken@1895
   732
 * \sa SDL_SetFullscreenDisplayMode()
slouken@1895
   733
 */
slouken@1895
   734
extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_WindowID windowID,
slouken@1895
   735
                                                    int fullscreen);
slouken@1895
   736
slouken@1895
   737
/**
slouken@1895
   738
 * \fn void SDL_SetWindowGrab(SDL_WindowID windowID, int mode)
slouken@1895
   739
 *
slouken@1895
   740
 * \brief Set the window's input grab mode.
slouken@1895
   741
 *
slouken@1895
   742
 * \param mode This is 1 to grab input, and 0 to release input.
slouken@1895
   743
 *
slouken@1895
   744
 * \sa SDL_GetWindowGrab()
slouken@1895
   745
 */
slouken@1895
   746
extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_WindowID windowID,
slouken@1895
   747
                                               int mode);
slouken@1895
   748
slouken@1895
   749
/**
slouken@1895
   750
 * \fn int SDL_GetWindowGrab(SDL_WindowID windowID)
slouken@1895
   751
 *
slouken@1895
   752
 * \brief Get the window's input grab mode.
slouken@1895
   753
 *
slouken@1895
   754
 * \return This returns 1 if input is grabbed, and 0 otherwise.
slouken@1895
   755
 *
slouken@1895
   756
 * \sa SDL_SetWindowGrab()
slouken@1895
   757
 */
slouken@1895
   758
extern DECLSPEC int SDLCALL SDL_GetWindowGrab(SDL_WindowID windowID);
slouken@1895
   759
slouken@1895
   760
/**
slouken@1895
   761
 * \fn SDL_bool SDL_GetWindowWMInfo(SDL_WindowID windowID, struct SDL_SysWMinfo * info)
slouken@1895
   762
 *
slouken@1895
   763
 * \brief Get driver specific information about a window.
slouken@1895
   764
 *
slouken@1895
   765
 * \note Include SDL_syswm.h for the declaration of SDL_SysWMinfo.
slouken@1895
   766
 */
slouken@1895
   767
struct SDL_SysWMinfo;
slouken@1895
   768
extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_WindowID windowID,
slouken@1895
   769
                                                     struct SDL_SysWMinfo
slouken@1895
   770
                                                     *info);
slouken@1895
   771
slouken@1895
   772
/**
slouken@1895
   773
 * \fn void SDL_DestroyWindow(SDL_WindowID windowID)
slouken@1895
   774
 *
slouken@1895
   775
 * \brief Destroy a window.
slouken@1895
   776
 */
slouken@1895
   777
extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_WindowID windowID);
slouken@1895
   778
slouken@1895
   779
/**
slouken@1969
   780
 * \fn int SDL_GetNumRenderDrivers(void)
slouken@1895
   781
 *
slouken@1969
   782
 * \brief Get the number of 2D rendering drivers available for the current display.
slouken@1895
   783
 *
slouken@1969
   784
 * A render driver is a set of code that handles rendering and texture
slouken@1895
   785
 * management on a particular display.  Normally there is only one, but
slouken@1895
   786
 * some drivers may have several available with different capabilities.
slouken@1895
   787
 *
slouken@1969
   788
 * \sa SDL_GetRenderDriverInfo()
slouken@1895
   789
 * \sa SDL_CreateRenderer()
slouken@1895
   790
 */
slouken@1969
   791
extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
slouken@1895
   792
slouken@1895
   793
/**
slouken@1969
   794
 * \fn int SDL_GetRenderDriverInfo(int index, SDL_RendererInfo *info)
slouken@1895
   795
 *
slouken@1969
   796
 * \brief Get information about a specific 2D rendering driver for the current display.
slouken@1895
   797
 *
slouken@1969
   798
 * \param index The index of the driver to query information about.
slouken@1969
   799
 * \param info A pointer to an SDL_RendererInfo struct to be filled with information on the rendering driver.
slouken@1907
   800
 *
slouken@1907
   801
 * \return 0 on success, -1 if the index was out of range
slouken@1907
   802
 *
slouken@1895
   803
 * \sa SDL_CreateRenderer()
slouken@1895
   804
 */
slouken@1969
   805
extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index,
slouken@1969
   806
                                                    SDL_RendererInfo * info);
slouken@1895
   807
slouken@1895
   808
/**
slouken@1895
   809
 * \fn int SDL_CreateRenderer(SDL_WindowID window, int index, Uint32 flags)
slouken@1895
   810
 *
slouken@1895
   811
 * \brief Create and make active a 2D rendering context for a window.
slouken@1895
   812
 *
slouken@1895
   813
 * \param windowID The window used for rendering
slouken@1969
   814
 * \param index The index of the rendering driver to initialize, or -1 to initialize the first one supporting the requested flags.
slouken@1895
   815
 * \param flags SDL_RendererFlags
slouken@1895
   816
 *
slouken@1895
   817
 * \return 0 on success, -1 if the flags were not supported, or -2 if
slouken@1895
   818
 *         there isn't enough memory to support the requested flags
slouken@1895
   819
 *
slouken@1895
   820
 * \sa SDL_SelectRenderer()
slouken@1969
   821
 * \sa SDL_GetRendererInfo()
slouken@1895
   822
 * \sa SDL_DestroyRenderer()
slouken@1895
   823
 */
slouken@1895
   824
extern DECLSPEC int SDLCALL SDL_CreateRenderer(SDL_WindowID windowID,
slouken@1895
   825
                                               int index, Uint32 flags);
slouken@1895
   826
slouken@1895
   827
/**
slouken@1895
   828
 * \fn int SDL_SelectRenderer(SDL_WindowID windowID)
slouken@1895
   829
 *
slouken@1895
   830
 * \brief Select the rendering context for a particular window.
slouken@1895
   831
 *
slouken@1895
   832
 * \return 0 on success, -1 if the selected window doesn't have a
slouken@1895
   833
 *         rendering context.
slouken@1895
   834
 */
slouken@1895
   835
extern DECLSPEC int SDLCALL SDL_SelectRenderer(SDL_WindowID windowID);
slouken@1895
   836
slouken@1895
   837
/**
slouken@1969
   838
 * \fn int SDL_GetRendererInfo(SDL_RendererInfo *info)
slouken@1969
   839
 *
slouken@1969
   840
 * \brief Get information about the current rendering context.
slouken@1969
   841
 */
slouken@1969
   842
extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_RendererInfo * info);
slouken@1969
   843
slouken@1969
   844
/**
slouken@1895
   845
 * \fn SDL_TextureID SDL_CreateTexture(Uint32 format, int access, int w, int h)
slouken@1895
   846
 *
slouken@1895
   847
 * \brief Create a texture for the current rendering context.
slouken@1895
   848
 *
slouken@1895
   849
 * \param format The format of the texture
slouken@1895
   850
 * \param access One of the enumerated values in SDL_TextureAccess
slouken@1895
   851
 * \param w The width of the texture in pixels
slouken@1895
   852
 * \param h The height of the texture in pixels
slouken@1895
   853
 *
slouken@1969
   854
 * \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
   855
 *
slouken@1895
   856
 * \sa SDL_QueryTexture()
slouken@1895
   857
 * \sa SDL_DestroyTexture()
slouken@1895
   858
 */
slouken@1895
   859
extern DECLSPEC SDL_TextureID SDLCALL SDL_CreateTexture(Uint32 format,
slouken@1895
   860
                                                        int access, int w,
slouken@1895
   861
                                                        int h);
slouken@1895
   862
slouken@1895
   863
/**
slouken@2222
   864
 * \fn SDL_TextureID SDL_CreateTextureFromSurface(Uint32 format, SDL_Surface *surface)
slouken@1895
   865
 *
slouken@1895
   866
 * \brief Create a texture from an existing surface.
slouken@1895
   867
 *
slouken@1895
   868
 * \param format The format of the texture, or 0 to pick an appropriate format
slouken@1895
   869
 * \param surface The surface containing pixel data used to fill the texture
slouken@1895
   870
 *
slouken@1969
   871
 * \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
   872
 *
slouken@1895
   873
 * \note The surface is not modified or freed by this function.
slouken@1895
   874
 *
slouken@1895
   875
 * \sa SDL_QueryTexture()
slouken@1895
   876
 * \sa SDL_DestroyTexture()
slouken@1895
   877
 */
slouken@1895
   878
extern DECLSPEC SDL_TextureID SDLCALL SDL_CreateTextureFromSurface(Uint32
slouken@1895
   879
                                                                   format,
slouken@1895
   880
                                                                   SDL_Surface
slouken@1895
   881
                                                                   * surface);
slouken@1895
   882
slouken@1895
   883
/**
slouken@1895
   884
 * \fn int SDL_QueryTexture(SDL_TextureID textureID, Uint32 *format, int *access, int *w, int *h)
slouken@1895
   885
 *
slouken@1895
   886
 * \brief Query the attributes of a texture
slouken@1895
   887
 *
slouken@1895
   888
 * \param texture A texture to be queried
slouken@1895
   889
 * \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
   890
 * \param access A pointer filled in with the actual access to the texture.
slouken@1895
   891
 * \param w A pointer filled in with the width of the texture in pixels
slouken@1895
   892
 * \param h A pointer filled in with the height of the texture in pixels
slouken@1895
   893
 *
slouken@1895
   894
 * \return 0 on success, or -1 if the texture is not valid
slouken@1895
   895
 */
slouken@1895
   896
extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_TextureID textureID,
slouken@1895
   897
                                             Uint32 * format, int *access,
slouken@1895
   898
                                             int *w, int *h);
slouken@1895
   899
slouken@1895
   900
/**
slouken@1895
   901
 * \fn int SDL_QueryTexturePixels(SDL_TextureID textureID, void **pixels, int pitch)
slouken@1895
   902
 *
slouken@1895
   903
 * \brief Query the pixels of a texture, if the texture does not need to be locked for pixel access.
slouken@1895
   904
 *
slouken@2222
   905
 * \param texture A texture to be queried, which was created with SDL_TEXTUREACCESS_STREAMING
slouken@1895
   906
 * \param pixels A pointer filled with a pointer to the pixels for the texture 
slouken@1895
   907
 * \param pitch A pointer filled in with the pitch of the pixel data
slouken@1895
   908
 *
slouken@1895
   909
 * \return 0 on success, or -1 if the texture is not valid, or must be locked for pixel access.
slouken@1895
   910
 */
slouken@1895
   911
extern DECLSPEC int SDLCALL SDL_QueryTexturePixels(SDL_TextureID textureID,
slouken@1895
   912
                                                   void **pixels, int *pitch);
slouken@1895
   913
slouken@1895
   914
/**
slouken@1895
   915
 * \fn int SDL_SetTexturePalette(SDL_TextureID textureID, const SDL_Color * colors, int firstcolor, int ncolors)
slouken@1895
   916
 *
slouken@1895
   917
 * \brief Update an indexed texture with a color palette
slouken@1895
   918
 *
slouken@1895
   919
 * \param texture The texture to update
slouken@1895
   920
 * \param colors The array of RGB color data
slouken@1895
   921
 * \param firstcolor The first index to update
slouken@1895
   922
 * \param ncolors The number of palette entries to fill with the color data
slouken@1895
   923
 *
slouken@1895
   924
 * \return 0 on success, or -1 if the texture is not valid or not an indexed texture
slouken@1895
   925
 */
slouken@1895
   926
extern DECLSPEC int SDLCALL SDL_SetTexturePalette(SDL_TextureID textureID,
slouken@1895
   927
                                                  const SDL_Color * colors,
slouken@1895
   928
                                                  int firstcolor,
slouken@1895
   929
                                                  int ncolors);
slouken@1895
   930
slouken@1895
   931
/**
slouken@1895
   932
 * \fn int SDL_GetTexturePalette(SDL_TextureID textureID, SDL_Color * colors, int firstcolor, int ncolors)
slouken@1895
   933
 *
slouken@1895
   934
 * \brief Update an indexed texture with a color palette
slouken@1895
   935
 *
slouken@1895
   936
 * \param texture The texture to update
slouken@1895
   937
 * \param colors The array to fill with RGB color data
slouken@1895
   938
 * \param firstcolor The first index to retrieve
slouken@1895
   939
 * \param ncolors The number of palette entries to retrieve
slouken@1895
   940
 *
slouken@1895
   941
 * \return 0 on success, or -1 if the texture is not valid or not an indexed texture
slouken@1895
   942
 */
slouken@1895
   943
extern DECLSPEC int SDLCALL SDL_GetTexturePalette(SDL_TextureID textureID,
slouken@1895
   944
                                                  SDL_Color * colors,
slouken@1895
   945
                                                  int firstcolor,
slouken@1895
   946
                                                  int ncolors);
slouken@1895
   947
slouken@1895
   948
/**
slouken@1985
   949
 * \fn int SDL_SetTextureColorMod(SDL_TextureID textureID, Uint8 r, Uint8 g, Uint8 b)
slouken@1985
   950
 *
slouken@1985
   951
 * \brief Set an additional color value used in render copy operations
slouken@1985
   952
 *
slouken@1985
   953
 * \param texture The texture to update
slouken@1985
   954
 * \param r The red source color value multiplied into copy operations
slouken@1985
   955
 * \param g The green source color value multiplied into copy operations
slouken@1985
   956
 * \param b The blue source color value multiplied into copy operations
slouken@1985
   957
 *
slouken@1985
   958
 * \return 0 on success, or -1 if the texture is not valid or color modulation is not supported
slouken@1985
   959
 *
slouken@1985
   960
 * \sa SDL_GetTextureColorMod()
slouken@1985
   961
 */
slouken@1985
   962
extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_TextureID textureID,
slouken@1985
   963
                                                   Uint8 r, Uint8 g, Uint8 b);
slouken@1985
   964
slouken@1985
   965
slouken@1985
   966
/**
slouken@1985
   967
 * \fn int SDL_GetTextureColorMod(SDL_TextureID textureID, Uint8 *r, Uint8 *g, Uint8 *b)
slouken@1985
   968
 *
slouken@1985
   969
 * \brief Get the additional color value used in render copy operations
slouken@1985
   970
 *
slouken@1985
   971
 * \param texture The texture to query
slouken@1985
   972
 * \param r A pointer filled in with the source red color value
slouken@1985
   973
 * \param g A pointer filled in with the source green color value
slouken@1985
   974
 * \param b A pointer filled in with the source blue color value
slouken@1985
   975
 *
slouken@1985
   976
 * \return 0 on success, or -1 if the texture is not valid
slouken@1985
   977
 *
slouken@1985
   978
 * \sa SDL_SetTextureColorMod()
slouken@1985
   979
 */
slouken@1985
   980
extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_TextureID textureID,
slouken@1985
   981
                                                   Uint8 * r, Uint8 * g,
slouken@1985
   982
                                                   Uint8 * b);
slouken@1985
   983
slouken@1985
   984
/**
slouken@1985
   985
 * \fn int SDL_SetTextureAlphaMod(SDL_TextureID textureID, Uint8 alpha)
slouken@1985
   986
 *
slouken@1985
   987
 * \brief Set an additional alpha value used in render copy operations
slouken@1985
   988
 *
slouken@1985
   989
 * \param texture The texture to update
slouken@1985
   990
 * \param alpha The source alpha value multiplied into copy operations.
slouken@1985
   991
 *
slouken@1985
   992
 * \return 0 on success, or -1 if the texture is not valid or alpha modulation is not supported
slouken@1985
   993
 *
slouken@1985
   994
 * \sa SDL_GetTextureAlphaMod()
slouken@1985
   995
 */
slouken@1985
   996
extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_TextureID textureID,
slouken@1985
   997
                                                   Uint8 alpha);
slouken@1985
   998
slouken@1985
   999
/**
slouken@1985
  1000
 * \fn int SDL_GetTextureAlphaMod(SDL_TextureID textureID, Uint8 *alpha)
slouken@1985
  1001
 *
slouken@1985
  1002
 * \brief Get the additional alpha value used in render copy operations
slouken@1985
  1003
 *
slouken@1985
  1004
 * \param texture The texture to query
slouken@1985
  1005
 * \param alpha A pointer filled in with the source alpha value
slouken@1985
  1006
 *
slouken@1985
  1007
 * \return 0 on success, or -1 if the texture is not valid
slouken@1985
  1008
 *
slouken@1985
  1009
 * \sa SDL_SetTextureAlphaMod()
slouken@1985
  1010
 */
slouken@1985
  1011
extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_TextureID textureID,
slouken@1985
  1012
                                                   Uint8 * alpha);
slouken@1985
  1013
slouken@1985
  1014
/**
slouken@1985
  1015
 * \fn int SDL_SetTextureBlendMode(SDL_TextureID textureID, int blendMode)
slouken@1985
  1016
 *
slouken@1985
  1017
 * \brief Set the blend mode used for texture copy operations
slouken@1985
  1018
 *
slouken@1985
  1019
 * \param texture The texture to update
slouken@1985
  1020
 * \param blendMode SDL_TextureBlendMode to use for texture blending
slouken@1985
  1021
 *
slouken@1985
  1022
 * \return 0 on success, or -1 if the texture is not valid or the blend mode is not supported
slouken@1985
  1023
 *
slouken@1985
  1024
 * \note If the blend mode is not supported, the closest supported mode is chosen.
slouken@1985
  1025
 *
slouken@1985
  1026
 * \sa SDL_GetTextureBlendMode()
slouken@1985
  1027
 */
slouken@1985
  1028
extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_TextureID textureID,
slouken@1985
  1029
                                                    int blendMode);
slouken@1985
  1030
slouken@1985
  1031
/**
slouken@1985
  1032
 * \fn int SDL_GetTextureBlendMode(SDL_TextureID textureID, int *blendMode)
slouken@1985
  1033
 *
slouken@1985
  1034
 * \brief Get the blend mode used for texture copy operations
slouken@1985
  1035
 *
slouken@1985
  1036
 * \param texture The texture to query
slouken@1985
  1037
 * \param blendMode A pointer filled in with the current blend mode
slouken@1985
  1038
 *
slouken@1985
  1039
 * \return 0 on success, or -1 if the texture is not valid
slouken@1985
  1040
 *
slouken@1985
  1041
 * \sa SDL_SetTextureBlendMode()
slouken@1985
  1042
 */
slouken@1985
  1043
extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_TextureID textureID,
slouken@1985
  1044
                                                    int *blendMode);
slouken@1985
  1045
slouken@1985
  1046
/**
slouken@1985
  1047
 * \fn int SDL_SetTextureScaleMode(SDL_TextureID textureID, int scaleMode)
slouken@1985
  1048
 *
slouken@1985
  1049
 * \brief Set the scale mode used for texture copy operations
slouken@1985
  1050
 *
slouken@1985
  1051
 * \param texture The texture to update
slouken@1985
  1052
 * \param scaleMode SDL_TextureScaleMode to use for texture scaling
slouken@1985
  1053
 *
slouken@1985
  1054
 * \return 0 on success, or -1 if the texture is not valid or the scale mode is not supported
slouken@1985
  1055
 *
slouken@1985
  1056
 * \note If the scale mode is not supported, the closest supported mode is chosen.
slouken@1985
  1057
 *
slouken@1985
  1058
 * \sa SDL_GetTextureScaleMode()
slouken@1985
  1059
 */
slouken@1985
  1060
extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_TextureID textureID,
slouken@1985
  1061
                                                    int scaleMode);
slouken@1985
  1062
slouken@1985
  1063
/**
slouken@1985
  1064
 * \fn int SDL_GetTextureScaleMode(SDL_TextureID textureID, int *scaleMode)
slouken@1985
  1065
 *
slouken@1985
  1066
 * \brief Get the scale mode used for texture copy operations
slouken@1985
  1067
 *
slouken@1985
  1068
 * \param texture The texture to query
slouken@1985
  1069
 * \param scaleMode A pointer filled in with the current scale mode
slouken@1985
  1070
 *
slouken@1985
  1071
 * \return 0 on success, or -1 if the texture is not valid
slouken@1985
  1072
 *
slouken@1985
  1073
 * \sa SDL_SetTextureScaleMode()
slouken@1985
  1074
 */
slouken@1985
  1075
extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_TextureID textureID,
slouken@1985
  1076
                                                    int *scaleMode);
slouken@1985
  1077
slouken@1985
  1078
/**
slouken@1895
  1079
 * \fn int SDL_UpdateTexture(SDL_TextureID textureID, const SDL_Rect *rect, const void *pixels, int pitch)
slouken@1895
  1080
 *
slouken@1895
  1081
 * \brief Update the given texture rectangle with new pixel data.
slouken@1895
  1082
 *
slouken@1895
  1083
 * \param texture The texture to update
slouken@1895
  1084
 * \param rect A pointer to the rectangle of pixels to update, or NULL to update the entire texture.
slouken@1895
  1085
 * \param pixels The raw pixel data
slouken@1895
  1086
 * \param pitch The number of bytes between rows of pixel data
slouken@1895
  1087
 *
slouken@1895
  1088
 * \return 0 on success, or -1 if the texture is not valid
slouken@1895
  1089
 *
slouken@2222
  1090
 * \note This is a fairly slow function.
slouken@1895
  1091
 */
slouken@1895
  1092
extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_TextureID textureID,
slouken@1895
  1093
                                              const SDL_Rect * rect,
slouken@1895
  1094
                                              const void *pixels, int pitch);
slouken@1895
  1095
slouken@1895
  1096
/**
slouken@1895
  1097
 * \fn void SDL_LockTexture(SDL_TextureID textureID, const SDL_Rect *rect, int markDirty, void **pixels, int *pitch)
slouken@1895
  1098
 *
slouken@1895
  1099
 * \brief Lock a portion of the texture for pixel access.
slouken@1895
  1100
 *
slouken@2222
  1101
 * \param textureID The texture to lock for access, which was created with SDL_TEXTUREACCESS_STREAMING.
slouken@1895
  1102
 * \param rect A pointer to the rectangle to lock for access. If the rect is NULL, the entire texture will be locked.
slouken@1895
  1103
 * \param markDirty If this is nonzero, the locked area will be marked dirty when the texture is unlocked.
slouken@1895
  1104
 * \param pixels This is filled in with a pointer to the locked pixels, appropriately offset by the locked area.
slouken@1895
  1105
 * \param pitch This is filled in with the pitch of the locked pixels.
slouken@1895
  1106
 *
slouken@2222
  1107
 * \return 0 on success, or -1 if the texture is not valid or was created with SDL_TEXTUREACCESS_STATIC
slouken@1895
  1108
 *
slouken@1895
  1109
 * \sa SDL_DirtyTexture()
slouken@1895
  1110
 * \sa SDL_UnlockTexture()
slouken@1895
  1111
 */
slouken@1895
  1112
extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_TextureID textureID,
slouken@1895
  1113
                                            const SDL_Rect * rect,
slouken@1895
  1114
                                            int markDirty, void **pixels,
slouken@1895
  1115
                                            int *pitch);
slouken@1895
  1116
slouken@1895
  1117
/**
slouken@1895
  1118
 * \fn void SDL_UnlockTexture(SDL_TextureID textureID)
slouken@1895
  1119
 *
slouken@1895
  1120
 * \brief Unlock a texture, uploading the changes to video memory, if needed.
slouken@1895
  1121
 *
slouken@1895
  1122
 * \sa SDL_LockTexture()
slouken@1895
  1123
 * \sa SDL_DirtyTexture()
slouken@1895
  1124
 */
slouken@1895
  1125
extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_TextureID textureID);
slouken@1895
  1126
slouken@1895
  1127
/**
slouken@1895
  1128
 * \fn void SDL_DirtyTexture(SDL_TextureID textureID, int numrects, const SDL_Rect * rects)
slouken@1895
  1129
 *
slouken@1895
  1130
 * \brief Mark the specified rectangles of the texture as dirty.
slouken@1895
  1131
 *
slouken@2222
  1132
 * \param textureID The texture to mark dirty, which was created with SDL_TEXTUREACCESS_STREAMING.
slouken@2222
  1133
 * \param numrects The number of rectangles pointed to by rects.
slouken@2222
  1134
 * \param rects The pointer to an array of dirty rectangles.
slouken@1895
  1135
 *
slouken@1895
  1136
 * \sa SDL_LockTexture()
slouken@1895
  1137
 * \sa SDL_UnlockTexture()
slouken@1895
  1138
 */
slouken@1895
  1139
extern DECLSPEC void SDLCALL SDL_DirtyTexture(SDL_TextureID textureID,
slouken@1895
  1140
                                              int numrects,
slouken@1895
  1141
                                              const SDL_Rect * rects);
slouken@1895
  1142
slouken@1895
  1143
/**
slouken@2884
  1144
 * \fn void SDL_SetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a)
slouken@1895
  1145
 *
slouken@2884
  1146
 * \brief Set the color used for drawing operations (Fill and Line).
slouken@2884
  1147
 *
slouken@2884
  1148
 * \param r The red value used to draw on the rendering target
slouken@2884
  1149
 * \param g The green value used to draw on the rendering target
slouken@2884
  1150
 * \param b The blue value used to draw on the rendering target
slouken@2884
  1151
 * \param a The alpha value used to draw on the rendering target, usually SDL_ALPHA_OPAQUE (255)
slouken@2884
  1152
 * \return 0 on success, or -1 if there is no rendering context current
slouken@2884
  1153
 */
slouken@2884
  1154
extern DECLSPEC int SDL_SetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b,
slouken@2884
  1155
                                           Uint8 a);
slouken@2884
  1156
slouken@2884
  1157
/**
slouken@2884
  1158
 * \fn void SDL_GetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a)
slouken@2884
  1159
 *
slouken@2884
  1160
 * \brief Get the color used for drawing operations (Fill and Line).
slouken@2884
  1161
 *
slouken@2884
  1162
 * \param r A pointer to the red value used to draw on the rendering target
slouken@2884
  1163
 * \param g A pointer to the green value used to draw on the rendering target
slouken@2884
  1164
 * \param b A pointer to the blue value used to draw on the rendering target
slouken@2884
  1165
 * \param a A pointer to the alpha value used to draw on the rendering target, usually SDL_ALPHA_OPAQUE (255)
slouken@2884
  1166
 * \return 0 on success, or -1 if there is no rendering context current
slouken@2884
  1167
 */
slouken@2884
  1168
extern DECLSPEC int SDL_GetRenderDrawColor(Uint8 * r, Uint8 * g, Uint8 * b,
slouken@2884
  1169
                                           Uint8 * a);
slouken@2884
  1170
slouken@2884
  1171
/**
slouken@2884
  1172
 * \fn int SDL_SetRenderDrawBlendMode(int blendMode)
slouken@2884
  1173
 *
slouken@2886
  1174
 * \brief Set the blend mode used for drawing operations (Fill and Line).
slouken@2884
  1175
 *
slouken@2884
  1176
 * \param blendMode SDL_BlendMode to use for blending
slouken@2884
  1177
 *
slouken@2884
  1178
 * \return 0 on success, or -1 if there is no rendering context current
slouken@2884
  1179
 *
slouken@2884
  1180
 * \note If the blend mode is not supported, the closest supported mode is chosen.
slouken@2884
  1181
 *
slouken@2884
  1182
 * \sa SDL_SetRenderDrawBlendMode()
slouken@2884
  1183
 */
slouken@2884
  1184
extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(int blendMode);
slouken@2884
  1185
slouken@2884
  1186
/**
slouken@2884
  1187
 * \fn int SDL_GetRenderDrawBlendMode(int *blendMode)
slouken@2884
  1188
 *
slouken@2884
  1189
 * \brief Get the blend mode used for drawing operations
slouken@2884
  1190
 *
slouken@2884
  1191
 * \param blendMode A pointer filled in with the current blend mode
slouken@2884
  1192
 *
slouken@2884
  1193
 * \return 0 on success, or -1 if there is no rendering context current
slouken@2884
  1194
 *
slouken@2884
  1195
 * \sa SDL_SetRenderDrawBlendMode()
slouken@2884
  1196
 */
slouken@2884
  1197
extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(int *blendMode);
slouken@2884
  1198
slouken@2884
  1199
/**
slouken@2901
  1200
 * \fn int SDL_RenderPoint(int x, int y)
slouken@2901
  1201
 *
slouken@2901
  1202
 * \brief Draw a point on the current rendering target.
slouken@2901
  1203
 *
slouken@2901
  1204
 * \param x The x coordinate of the point
slouken@2901
  1205
 * \param y The y coordinate of the point
slouken@2901
  1206
 *
slouken@2901
  1207
 * \return 0 on success, or -1 if there is no rendering context current
slouken@2901
  1208
 */
slouken@2901
  1209
extern DECLSPEC int SDLCALL SDL_RenderPoint(int x, int y);
slouken@2901
  1210
slouken@2901
  1211
/**
slouken@2886
  1212
 * \fn int SDL_RenderLine(int x1, int y1, int x2, int y2)
slouken@2884
  1213
 *
slouken@2884
  1214
 * \brief Draw a line on the current rendering target.
slouken@2884
  1215
 *
slouken@2884
  1216
 * \param x1 The x coordinate of the start point
slouken@2884
  1217
 * \param y1 The y coordinate of the start point
slouken@2884
  1218
 * \param x2 The x coordinate of the end point
slouken@2884
  1219
 * \param y2 The y coordinate of the end point
slouken@2884
  1220
 *
slouken@2884
  1221
 * \return 0 on success, or -1 if there is no rendering context current
slouken@2884
  1222
 */
slouken@2884
  1223
extern DECLSPEC int SDLCALL SDL_RenderLine(int x1, int y1, int x2, int y2);
slouken@2884
  1224
slouken@2884
  1225
/**
slouken@2884
  1226
 * \fn void SDL_RenderFill(const SDL_Rect *rect)
slouken@2884
  1227
 *
slouken@2884
  1228
 * \brief Fill the current rendering target with the drawing color.
slouken@1895
  1229
 *
slouken@1985
  1230
 * \param r The red value used to fill the rendering target
slouken@1985
  1231
 * \param g The green value used to fill the rendering target
slouken@1985
  1232
 * \param b The blue value used to fill the rendering target
slouken@1985
  1233
 * \param a The alpha value used to fill the rendering target, usually SDL_ALPHA_OPAQUE (255)
slouken@1895
  1234
 * \param rect A pointer to the destination rectangle, or NULL for the entire rendering target.
slouken@1895
  1235
 *
slouken@1969
  1236
 * \return 0 on success, or -1 if there is no rendering context current
slouken@1895
  1237
 */
slouken@2884
  1238
extern DECLSPEC int SDLCALL SDL_RenderFill(const SDL_Rect * rect);
slouken@1895
  1239
slouken@1895
  1240
/**
slouken@1985
  1241
 * \fn int SDL_RenderCopy(SDL_TextureID textureID, const SDL_Rect *srcrect, const SDL_Rect *dstrect)
slouken@1895
  1242
 *
slouken@1895
  1243
 * \brief Copy a portion of the texture to the current rendering target.
slouken@1895
  1244
 *
slouken@1895
  1245
 * \param texture The source texture.
slouken@1895
  1246
 * \param srcrect A pointer to the source rectangle, or NULL for the entire texture.
slouken@1895
  1247
 * \param dstrect A pointer to the destination rectangle, or NULL for the entire rendering target.
slouken@1895
  1248
 *
slouken@1969
  1249
 * \return 0 on success, or -1 if there is no rendering context current, or the driver doesn't support the requested operation.
slouken@1895
  1250
 */
slouken@1895
  1251
extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_TextureID textureID,
slouken@1895
  1252
                                           const SDL_Rect * srcrect,
slouken@1985
  1253
                                           const SDL_Rect * dstrect);
slouken@1895
  1254
slouken@1895
  1255
/**
slouken@1895
  1256
 * \fn int SDL_RenderReadPixels(const SDL_Rect *rect, void *pixels, int pitch)
slouken@1895
  1257
 *
slouken@1895
  1258
 * \brief Read pixels from the current rendering target.
slouken@1895
  1259
 *
slouken@1895
  1260
 * \param rect A pointer to the rectangle to read, or NULL for the entire render target
slouken@1895
  1261
 * \param pixels A pointer to be filled in with the pixel data
slouken@1895
  1262
 * \param pitch The pitch of the pixels parameter
slouken@1895
  1263
 *
slouken@1895
  1264
 * \return 0 on success, or -1 if pixel reading is not supported.
slouken@1895
  1265
 *
slouken@1895
  1266
 * \warning This is a very slow operation, and should not be used frequently.
slouken@1895
  1267
 */
slouken@1895
  1268
extern DECLSPEC int SDLCALL SDL_RenderReadPixels(const SDL_Rect * rect,
slouken@1895
  1269
                                                 void *pixels, int pitch);
slouken@1895
  1270
slouken@1895
  1271
/**
slouken@1895
  1272
 * \fn int SDL_RenderWritePixels(const SDL_Rect *rect, const void *pixels, int pitch)
slouken@1895
  1273
 *
slouken@1895
  1274
 * \brief Write pixels to the current rendering target.
slouken@1895
  1275
 *
slouken@1895
  1276
 * \param rect A pointer to the rectangle to write, or NULL for the entire render target
slouken@1895
  1277
 * \param pixels A pointer to the pixel data to write
slouken@1895
  1278
 * \param pitch The pitch of the pixels parameter
slouken@1895
  1279
 *
slouken@1895
  1280
 * \return 0 on success, or -1 if pixel writing is not supported.
slouken@1895
  1281
 *
slouken@1895
  1282
 * \warning This is a very slow operation, and should not be used frequently.
slouken@1895
  1283
 */
slouken@1895
  1284
extern DECLSPEC int SDLCALL SDL_RenderWritePixels(const SDL_Rect * rect,
slouken@1895
  1285
                                                  const void *pixels,
slouken@1895
  1286
                                                  int pitch);
slouken@1895
  1287
slouken@1895
  1288
/**
slouken@1895
  1289
 * \fn void SDL_RenderPresent(void)
slouken@1895
  1290
 *
slouken@1895
  1291
 * \brief Update the screen with rendering performed.
slouken@1895
  1292
 */
slouken@1895
  1293
extern DECLSPEC void SDLCALL SDL_RenderPresent(void);
slouken@1895
  1294
slouken@1895
  1295
/**
slouken@1895
  1296
 * \fn void SDL_DestroyTexture(SDL_TextureID textureID);
slouken@1895
  1297
 *
slouken@1895
  1298
 * \brief Destroy the specified texture.
slouken@1895
  1299
 *
slouken@1895
  1300
 * \sa SDL_CreateTexture()
slouken@1895
  1301
 * \sa SDL_CreateTextureFromSurface()
slouken@1895
  1302
 */
slouken@1895
  1303
extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_TextureID textureID);
slouken@1895
  1304
slouken@1895
  1305
/**
slouken@1895
  1306
 * \fn void SDL_DestroyRenderer(SDL_WindowID windowID);
slouken@1895
  1307
 *
slouken@1895
  1308
 * \brief Destroy the rendering context for a window and free associated
slouken@1895
  1309
 *        textures.
slouken@1895
  1310
 *
slouken@1895
  1311
 * \sa SDL_CreateRenderer()
slouken@1895
  1312
 */
slouken@1895
  1313
extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_WindowID windowID);
slouken@0
  1314
slouken@0
  1315
slouken@0
  1316
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
slouken@0
  1317
/* OpenGL support functions.                                                 */
slouken@0
  1318
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
slouken@0
  1319
slouken@1895
  1320
/**
slouken@1895
  1321
 * \fn int SDL_GL_LoadLibrary(const char *path)
slouken@0
  1322
 *
slouken@1895
  1323
 * \brief Dynamically load an OpenGL library.
slouken@1895
  1324
 *
slouken@1895
  1325
 * \param path The platform dependent OpenGL library name, or NULL to open the default OpenGL library
slouken@1895
  1326
 *
slouken@1895
  1327
 * \return 0 on success, or -1 if the library couldn't be loaded
slouken@1895
  1328
 *
slouken@1936
  1329
 * This should be done after initializing the video driver, but before
slouken@1936
  1330
 * creating any OpenGL windows.  If no OpenGL library is loaded, the default
slouken@1936
  1331
 * library will be loaded upon creation of the first OpenGL window.
slouken@1936
  1332
 *
slouken@1895
  1333
 * \note If you do this, you need to retrieve all of the GL functions used in
slouken@1895
  1334
 *       your program from the dynamic library using SDL_GL_GetProcAddress().
slouken@1895
  1335
 *
slouken@1895
  1336
 * \sa SDL_GL_GetProcAddress()
slouken@0
  1337
 */
slouken@337
  1338
extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
slouken@0
  1339
slouken@1895
  1340
/**
slouken@1895
  1341
 * \fn void *SDL_GL_GetProcAddress(const char *proc)
slouken@1895
  1342
 *
slouken@1895
  1343
 * \brief Get the address of an OpenGL function.
slouken@0
  1344
 */
slouken@1895
  1345
extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc);
slouken@0
  1346
slouken@1895
  1347
/**
slouken@1926
  1348
 * \fn SDL_bool SDL_GL_ExtensionSupported(const char *extension)
slouken@1926
  1349
 *
slouken@1926
  1350
 * \brief Return true if an OpenGL extension is supported for the current context.
slouken@1926
  1351
 */
slouken@1926
  1352
extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char
slouken@1926
  1353
                                                           *extension);
slouken@1926
  1354
slouken@1926
  1355
/**
slouken@1895
  1356
 * \fn int SDL_GL_SetAttribute(SDL_GLattr attr, int value)
slouken@1895
  1357
 *
slouken@1895
  1358
 * \brief Set an OpenGL window attribute before window creation.
slouken@0
  1359
 */
slouken@337
  1360
extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
slouken@0
  1361
slouken@1895
  1362
/**
slouken@1895
  1363
 * \fn int SDL_GL_GetWindowAttribute(SDL_WindowID windowID, SDL_GLattr attr, int *value)
slouken@0
  1364
 *
slouken@1936
  1365
 * \brief Get the actual value for an attribute from the current context.
slouken@0
  1366
 */
slouken@1936
  1367
extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value);
slouken@0
  1368
slouken@1895
  1369
/**
slouken@1895
  1370
 * \fn SDL_GLContext SDL_GL_CreateContext(SDL_WindowID windowID)
slouken@1895
  1371
 *
slouken@1895
  1372
 * \brief Create an OpenGL context for use with an OpenGL window, and make it current.
slouken@1895
  1373
 *
slouken@1895
  1374
 * \sa SDL_GL_DeleteContext()
slouken@1895
  1375
 */
slouken@1895
  1376
extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_WindowID
slouken@1895
  1377
                                                           windowID);
slouken@1895
  1378
slouken@1895
  1379
/**
slouken@1895
  1380
 * \fn int SDL_GL_MakeCurrent(SDL_WindowID windowID, SDL_GLContext context)
slouken@1895
  1381
 *
slouken@1895
  1382
 * \brief Set up an OpenGL context for rendering into an OpenGL window.
slouken@1895
  1383
 *
slouken@1895
  1384
 * \note The context must have been created with a compatible window.
slouken@1895
  1385
 */
slouken@1895
  1386
extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_WindowID windowID,
slouken@1895
  1387
                                               SDL_GLContext context);
slouken@1895
  1388
slouken@1895
  1389
/**
slouken@1895
  1390
 * \fn int SDL_GL_SetSwapInterval(int interval)
slouken@1895
  1391
 *
slouken@1895
  1392
 * \brief Set the swap interval for the current OpenGL context.
slouken@1895
  1393
 *
slouken@1912
  1394
 * \param interval 0 for immediate updates, 1 for updates synchronized with the vertical retrace
slouken@1912
  1395
 *
slouken@1912
  1396
 * \return 0 on success, or -1 if setting the swap interval is not supported.
slouken@1912
  1397
 *
slouken@1895
  1398
 * \sa SDL_GL_GetSwapInterval()
slouken@1895
  1399
 */
slouken@1895
  1400
extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval);
slouken@1895
  1401
slouken@1895
  1402
/**
slouken@1895
  1403
 * \fn int SDL_GL_GetSwapInterval(void)
slouken@1895
  1404
 *
slouken@1895
  1405
 * \brief Get the swap interval for the current OpenGL context.
slouken@1895
  1406
 *
slouken@1912
  1407
 * \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
  1408
 *
slouken@1895
  1409
 * \sa SDL_GL_SetSwapInterval()
slouken@1895
  1410
 */
slouken@1895
  1411
extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void);
slouken@1895
  1412
slouken@1895
  1413
/**
slouken@1912
  1414
 * \fn void SDL_GL_SwapWindow(SDL_WindowID windowID)
slouken@1895
  1415
 *
slouken@1912
  1416
 * \brief Swap the OpenGL buffers for the window, if double-buffering is supported.
slouken@0
  1417
 */
slouken@1912
  1418
extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_WindowID windowID);
slouken@0
  1419
slouken@1895
  1420
/**
slouken@1895
  1421
 * \fn void SDL_GL_DeleteContext(SDL_GLContext context)
slouken@1895
  1422
 *
slouken@1895
  1423
 * \brief Delete an OpenGL context.
slouken@1895
  1424
 *
slouken@1895
  1425
 * \sa SDL_GL_CreateContext()
slouken@0
  1426
 */
slouken@1895
  1427
extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context);
slouken@0
  1428
slouken@0
  1429
slouken@0
  1430
/* Ends C function definitions when using C++ */
slouken@0
  1431
#ifdef __cplusplus
slouken@1895
  1432
/* *INDENT-OFF* */
slouken@0
  1433
}
slouken@1895
  1434
/* *INDENT-ON* */
slouken@0
  1435
#endif
slouken@0
  1436
#include "close_code.h"
slouken@0
  1437
slouken@0
  1438
#endif /* _SDL_video_h */
slouken@1895
  1439
slouken@1895
  1440
/* vi: set ts=4 sw=4 expandtab: */