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