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