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