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