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