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