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