include/SDL_video.h
author Sam Lantinga <slouken@libsdl.org>
Sat, 17 Oct 2009 07:36:45 +0000
changeset 3400 4ec48602f1db
parent 3227 458e53d8662c
child 3407 d3baf5ac4e37
permissions -rw-r--r--
iPhone interruption patch / SDL 1.3

Eric Wing to Sam

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