include/SDL_video.h
author Sam Lantinga <slouken@libsdl.org>
Mon, 19 Oct 2009 13:31:58 +0000
changeset 3407 d3baf5ac4e37
parent 3400 4ec48602f1db
child 3435 9f62f47d989b
permissions -rw-r--r--
Partial fix for bug #859

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