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