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