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