include/SDL_video.h
author Ryan C. Gordon <icculus@icculus.org>
Tue, 15 Dec 2009 18:00:16 +0000
changeset 3567 fb9ea4b549c3
parent 3536 0267b8b1595c
child 3596 f638ded38b8a
permissions -rw-r--r--
Added a warning comment to SDL_putenv().

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