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