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