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