include/SDL_video.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 29 Oct 2006 14:45:46 +0000
changeset 2063 dea73e1d07b0
parent 1986 f4c65e3bfaed
child 2102 0975e24a3670
permissions -rw-r--r--
Merged Ryan's fix, in case we need it later.
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2006 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 access to the SDL raw framebuffer window
    27  */
    28 
    29 #ifndef _SDL_video_h
    30 #define _SDL_video_h
    31 
    32 #include "SDL_stdinc.h"
    33 #include "SDL_error.h"
    34 #include "SDL_pixels.h"
    35 #include "SDL_rwops.h"
    36 
    37 #include "begin_code.h"
    38 /* Set up for C function definitions, even when using C++ */
    39 #ifdef __cplusplus
    40 /* *INDENT-OFF* */
    41 extern "C" {
    42 /* *INDENT-ON* */
    43 #endif
    44 
    45 /* Transparency definitions: These define alpha as the opacity of a surface */
    46 #define SDL_ALPHA_OPAQUE 255
    47 #define SDL_ALPHA_TRANSPARENT 0
    48 
    49 /**
    50  * \struct SDL_Rect
    51  *
    52  * \brief A rectangle, with the origin at the upper left.
    53  */
    54 typedef struct SDL_Rect
    55 {
    56     int x, y;
    57     int w, h;
    58 } SDL_Rect;
    59 
    60 /**
    61  * \struct SDL_DisplayMode
    62  *
    63  * \brief  The structure that defines a display mode
    64  *
    65  * \sa SDL_GetNumDisplayModes()
    66  * \sa SDL_GetDisplayMode()
    67  * \sa SDL_GetDesktopDisplayMode()
    68  * \sa SDL_GetCurrentDisplayMode()
    69  * \sa SDL_GetClosestDisplayMode()
    70  * \sa SDL_SetDisplayMode()
    71  */
    72 typedef struct
    73 {
    74     Uint32 format;              /**< pixel format */
    75     int w;                      /**< width */
    76     int h;                      /**< height */
    77     int refresh_rate;           /**< refresh rate (or zero for unspecified) */
    78     void *driverdata;           /**< driver-specific data, initialize to 0 */
    79 } SDL_DisplayMode;
    80 
    81 /**
    82  * \typedef SDL_WindowID
    83  *
    84  * \brief The type used to identify a window
    85  *
    86  * \sa SDL_CreateWindow()
    87  * \sa SDL_CreateWindowFrom()
    88  * \sa SDL_DestroyWindow()
    89  * \sa SDL_GetWindowData()
    90  * \sa SDL_GetWindowFlags()
    91  * \sa SDL_GetWindowGrab()
    92  * \sa SDL_GetWindowPosition()
    93  * \sa SDL_GetWindowSize()
    94  * \sa SDL_GetWindowTitle()
    95  * \sa SDL_HideWindow()
    96  * \sa SDL_MaximizeWindow()
    97  * \sa SDL_MinimizeWindow()
    98  * \sa SDL_RaiseWindow()
    99  * \sa SDL_RestoreWindow()
   100  * \sa SDL_SetWindowData()
   101  * \sa SDL_SetWindowFullscreen()
   102  * \sa SDL_SetWindowGrab()
   103  * \sa SDL_SetWindowIcon()
   104  * \sa SDL_SetWindowPosition()
   105  * \sa SDL_SetWindowSize()
   106  * \sa SDL_SetWindowTitle()
   107  * \sa SDL_ShowWindow()
   108  */
   109 typedef Uint32 SDL_WindowID;
   110 
   111 /**
   112  * \enum SDL_WindowFlags
   113  *
   114  * \brief The flags on a window
   115  *
   116  * \sa SDL_GetWindowFlags()
   117  */
   118 typedef enum
   119 {
   120     SDL_WINDOW_FULLSCREEN = 0x00000001,         /**< fullscreen window, implies borderless */
   121     SDL_WINDOW_OPENGL = 0x00000002,             /**< window usable with OpenGL context */
   122     SDL_WINDOW_SHOWN = 0x00000004,              /**< window is visible */
   123     SDL_WINDOW_BORDERLESS = 0x00000008,         /**< no window decoration */
   124     SDL_WINDOW_RESIZABLE = 0x00000010,          /**< window can be resized */
   125     SDL_WINDOW_MINIMIZED = 0x00000020,          /**< minimized */
   126     SDL_WINDOW_MAXIMIZED = 0x00000040,          /**< maximized */
   127     SDL_WINDOW_INPUT_GRABBED = 0x00000100,      /**< window has grabbed input focus */
   128     SDL_WINDOW_INPUT_FOCUS = 0x00000200,        /**< window has input focus */
   129     SDL_WINDOW_MOUSE_FOCUS = 0x00000400,        /**< window has mouse focus */
   130 } SDL_WindowFlags;
   131 
   132 /**
   133  * \def SDL_WINDOWPOS_UNDEFINED
   134  * \brief Used to indicate that you don't care what the window position is.
   135  */
   136 #define SDL_WINDOWPOS_UNDEFINED 0x7FFFFFF
   137 /**
   138  * \def SDL_WINDOWPOS_CENTERED
   139  * \brief Used to indicate that the window position should be centered.
   140  */
   141 #define SDL_WINDOWPOS_CENTERED  0x7FFFFFE
   142 
   143 /**
   144  * \enum SDL_WindowEventID
   145  *
   146  * \brief Event subtype for window events
   147  */
   148 typedef enum
   149 {
   150     SDL_WINDOWEVENT_NONE,               /**< Never used */
   151     SDL_WINDOWEVENT_SHOWN,              /**< Window has been shown */
   152     SDL_WINDOWEVENT_HIDDEN,             /**< Window has been hidden */
   153     SDL_WINDOWEVENT_EXPOSED,            /**< Window has been exposed and should be redrawn */
   154     SDL_WINDOWEVENT_MOVED,              /**< Window has been moved to data1,data2 */
   155     SDL_WINDOWEVENT_RESIZED,            /**< Window size changed to data1xdata2 */
   156     SDL_WINDOWEVENT_MINIMIZED,          /**< Window has been minimized */
   157     SDL_WINDOWEVENT_MAXIMIZED,          /**< Window has been maximized */
   158     SDL_WINDOWEVENT_RESTORED,           /**< Window has been restored to normal size and position */
   159     SDL_WINDOWEVENT_ENTER,              /**< The window has gained mouse focus */
   160     SDL_WINDOWEVENT_LEAVE,              /**< The window has lost mouse focus */
   161     SDL_WINDOWEVENT_FOCUS_GAINED,       /**< The window has gained keyboard focus */
   162     SDL_WINDOWEVENT_FOCUS_LOST,         /**< The window has lost keyboard focus */
   163     SDL_WINDOWEVENT_CLOSE,                              /**< The window manager requests that the window be closed */
   164 } SDL_WindowEventID;
   165 
   166 /**
   167  * \enum SDL_RendererFlags
   168  *
   169  * \brief Flags used when creating a rendering context
   170  */
   171 typedef enum
   172 {
   173     SDL_RENDERER_SINGLEBUFFER = 0x00000001,     /**< Render directly to the window, if possible */
   174     SDL_RENDERER_PRESENTCOPY = 0x00000002,      /**< Present uses a copy from back buffer to the front buffer */
   175     SDL_RENDERER_PRESENTFLIP2 = 0x00000004,     /**< Present uses a flip, swapping back buffer and front buffer */
   176     SDL_RENDERER_PRESENTFLIP3 = 0x00000008,     /**< Present uses a flip, rotating between two back buffers and a front buffer */
   177     SDL_RENDERER_PRESENTDISCARD = 0x00000010,   /**< Present leaves the contents of the backbuffer undefined */
   178     SDL_RENDERER_PRESENTVSYNC = 0x00000020,     /**< Present is synchronized with the refresh rate */
   179     SDL_RENDERER_ACCELERATED = 0x00000040,      /**< The renderer uses hardware acceleration */
   180 } SDL_RendererFlags;
   181 
   182 /**
   183  * \struct SDL_RendererInfo
   184  *
   185  * \brief Information on the capabilities of a render driver or context
   186  */
   187 typedef struct SDL_RendererInfo
   188 {
   189     const char *name;           /**< The name of the renderer */
   190     Uint32 flags;               /**< Supported SDL_RendererFlags */
   191     Uint32 mod_modes;           /**< A mask of supported channel modulation */
   192     Uint32 blend_modes;         /**< A mask of supported blend modes */
   193     Uint32 scale_modes;         /**< A mask of supported scale modes */
   194     Uint32 num_texture_formats; /**< The number of available texture formats */
   195     Uint32 texture_formats[20]; /**< The available texture formats */
   196     int max_texture_width;      /**< The maximimum texture width */
   197     int max_texture_height;     /**< The maximimum texture height */
   198 } SDL_RendererInfo;
   199 
   200 /**
   201  * \enum SDL_TextureAccess
   202  *
   203  * \brief The access pattern allowed for a texture
   204  */
   205 typedef enum
   206 {
   207     SDL_TEXTUREACCESS_LOCAL,    /**< Lockable system memory */
   208     SDL_TEXTUREACCESS_REMOTE,   /**< Unlockable video memory */
   209 } SDL_TextureAccess;
   210 
   211 /**
   212  * \enum SDL_TextureModulate
   213  *
   214  * \brief The texture channel modulation used in SDL_RenderCopy()
   215  */
   216 typedef enum
   217 {
   218     SDL_TEXTUREMODULATE_NONE = 0x00000000,     /**< No modulation */
   219     SDL_TEXTUREMODULATE_COLOR = 0x00000001,    /**< srcC = srcC * color */
   220     SDL_TEXTUREMODULATE_ALPHA = 0x00000002,    /**< srcA = srcA * alpha */
   221 } SDL_TextureModulate;
   222 
   223 /**
   224  * \enum SDL_TextureBlendMode
   225  *
   226  * \brief The texture blend mode used in SDL_RenderCopy()
   227  */
   228 typedef enum
   229 {
   230     SDL_TEXTUREBLENDMODE_NONE = 0x00000000,     /**< No blending */
   231     SDL_TEXTUREBLENDMODE_MASK = 0x00000001,     /**< dst = A ? src : dst (alpha is mask) */
   232     SDL_TEXTUREBLENDMODE_BLEND = 0x00000002,    /**< dst = (src * A) + (dst * (1-A)) */
   233     SDL_TEXTUREBLENDMODE_ADD = 0x00000004,      /**< dst = (src * A) + dst */
   234     SDL_TEXTUREBLENDMODE_MOD = 0x00000008,      /**< dst = src * dst */
   235 } SDL_TextureBlendMode;
   236 
   237 /**
   238  * \enum SDL_TextureScaleMode
   239  *
   240  * \brief The texture scale mode used in SDL_RenderCopy()
   241  */
   242 typedef enum
   243 {
   244     SDL_TEXTURESCALEMODE_NONE = 0x00000000,     /**< No scaling, rectangles must match dimensions */
   245     SDL_TEXTURESCALEMODE_FAST = 0x00000001,     /**< Point sampling or equivalent algorithm */
   246     SDL_TEXTURESCALEMODE_SLOW = 0x00000002,     /**< Linear filtering or equivalent algorithm */
   247     SDL_TEXTURESCALEMODE_BEST = 0x00000004,     /**< Bicubic filtering or equivalent algorithm */
   248 } SDL_TextureScaleMode;
   249 
   250 /**
   251  * \typedef SDL_TextureID
   252  *
   253  * \brief An efficient driver-specific representation of pixel data
   254  */
   255 typedef Uint32 SDL_TextureID;
   256 
   257 /**
   258  * \typedef SDL_GLContext
   259  *
   260  * \brief An opaque handle to an OpenGL context.
   261  */
   262 typedef void *SDL_GLContext;
   263 
   264 
   265 /* These are the currently supported flags for the SDL_surface */
   266 /* Used internally (read-only) */
   267 #define SDL_HWSURFACE       0x00000001  /* Surface represents a texture */
   268 #define SDL_PREALLOC        0x00000002  /* Surface uses preallocated memory */
   269 #define SDL_SRCALPHA        0x00000004  /* Blit uses source alpha blending */
   270 #define SDL_SRCCOLORKEY     0x00000008  /* Blit uses a source color key */
   271 #define SDL_RLEACCELOK      0x00000010  /* Private flag */
   272 #define SDL_RLEACCEL        0x00000020  /* Surface is RLE encoded */
   273 
   274 /* Evaluates to true if the surface needs to be locked before access */
   275 #define SDL_MUSTLOCK(S)	(((S)->flags & (SDL_HWSURFACE|SDL_RLEACCEL)) != 0)
   276 
   277 /* This structure should be treated as read-only, except for 'pixels',
   278    which, if not NULL, contains the raw pixel data for the surface.
   279 */
   280 typedef struct SDL_Surface
   281 {
   282     Uint32 flags;               /* Read-only */
   283     SDL_PixelFormat *format;    /* Read-only */
   284     int w, h;                   /* Read-only */
   285     int pitch;                  /* Read-only */
   286     void *pixels;               /* Read-write */
   287 
   288     /* Application data associated with the surfade */
   289     void *userdata;             /* Read-write */
   290 
   291     /* texture associated with the surface, if any */
   292     SDL_TextureID textureID;    /* Read-only */
   293 
   294     /* information needed for surfaces requiring locks */
   295     int locked;                 /* Read-only */
   296     void *lock_data;            /* Read-only */
   297 
   298     /* clipping information */
   299     SDL_Rect clip_rect;         /* Read-only */
   300 
   301     /* info for fast blit mapping to other surfaces */
   302     struct SDL_BlitMap *map;    /* Private */
   303 
   304     /* format version, bumped at every change to invalidate blit maps */
   305     unsigned int format_version;        /* Private */
   306 
   307     /* Reference count -- used when freeing surface */
   308     int refcount;               /* Read-mostly */
   309 } SDL_Surface;
   310 
   311 /* typedef for private surface blitting functions */
   312 typedef int (*SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect,
   313                          struct SDL_Surface * dst, SDL_Rect * dstrect);
   314 
   315 
   316 /**
   317  * \enum SDL_GLattr
   318  *
   319  * \brief OpenGL configuration attributes
   320  */
   321 typedef enum
   322 {
   323     SDL_GL_RED_SIZE,
   324     SDL_GL_GREEN_SIZE,
   325     SDL_GL_BLUE_SIZE,
   326     SDL_GL_ALPHA_SIZE,
   327     SDL_GL_BUFFER_SIZE,
   328     SDL_GL_DOUBLEBUFFER,
   329     SDL_GL_DEPTH_SIZE,
   330     SDL_GL_STENCIL_SIZE,
   331     SDL_GL_ACCUM_RED_SIZE,
   332     SDL_GL_ACCUM_GREEN_SIZE,
   333     SDL_GL_ACCUM_BLUE_SIZE,
   334     SDL_GL_ACCUM_ALPHA_SIZE,
   335     SDL_GL_STEREO,
   336     SDL_GL_MULTISAMPLEBUFFERS,
   337     SDL_GL_MULTISAMPLESAMPLES,
   338     SDL_GL_ACCELERATED_VISUAL
   339 } SDL_GLattr;
   340 
   341 
   342 /* Function prototypes */
   343 
   344 /**
   345  * \fn int SDL_GetNumVideoDrivers(void)
   346  *
   347  * \brief Get the number of video drivers compiled into SDL
   348  *
   349  * \sa SDL_GetVideoDriver()
   350  */
   351 extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void);
   352 
   353 /**
   354  * \fn const char *SDL_GetVideoDriver(int index)
   355  *
   356  * \brief Get the name of a built in video driver.
   357  *
   358  * \note The video drivers are presented in the order in which they are
   359  * normally checked during initialization.
   360  *
   361  * \sa SDL_GetNumVideoDrivers()
   362  */
   363 extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index);
   364 
   365 /**
   366  * \fn int SDL_VideoInit(const char *driver_name, Uint32 flags)
   367  *
   368  * \brief Initialize the video subsystem, optionally specifying a video driver.
   369  *
   370  * \param driver_name Initialize a specific driver by name, or NULL for the default video driver.
   371  * \param flags FIXME: Still needed?
   372  *
   373  * \return 0 on success, -1 on error
   374  *
   375  * This function initializes the video subsystem; setting up a connection
   376  * to the window manager, etc, and determines the available display modes
   377  * and pixel formats, but does not initialize a window or graphics mode.
   378  *
   379  * \sa SDL_VideoQuit()
   380  */
   381 extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name,
   382                                           Uint32 flags);
   383 
   384 /**
   385  * \fn void SDL_VideoQuit(void)
   386  *
   387  * \brief Shuts down the video subsystem.
   388  *
   389  * This function closes all windows, and restores the original video mode.
   390  *
   391  * \sa SDL_VideoInit()
   392  */
   393 extern DECLSPEC void SDLCALL SDL_VideoQuit(void);
   394 
   395 /**
   396  * \fn const char *SDL_GetCurrentVideoDriver(void)
   397  *
   398  * \brief Returns the name of the currently initialized video driver.
   399  *
   400  * \return The name of the current video driver or NULL if no driver
   401  *         has been initialized
   402  *
   403  * \sa SDL_GetNumVideoDrivers()
   404  * \sa SDL_GetVideoDriver()
   405  */
   406 extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void);
   407 
   408 /**
   409  * \fn int SDL_GetNumVideoDisplays(void)
   410  *
   411  * \brief Returns the number of available video displays.
   412  *
   413  * \sa SDL_SelectVideoDisplay()
   414  */
   415 extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void);
   416 
   417 /**
   418  * \fn int SDL_SelectVideoDisplay(int index)
   419  *
   420  * \brief Set the index of the currently selected display.
   421  *
   422  * \return 0 on success, or -1 if the index is out of range.
   423  *
   424  * \sa SDL_GetNumVideoDisplays()
   425  * \sa SDL_GetCurrentVideoDisplay()
   426  */
   427 extern DECLSPEC int SDLCALL SDL_SelectVideoDisplay(int index);
   428 
   429 /**
   430  * \fn int SDL_GetCurrentVideoDisplay(void)
   431  *
   432  * \brief Get the index of the currently selected display.
   433  *
   434  * \return The index of the currently selected display.
   435  *
   436  * \sa SDL_GetNumVideoDisplays()
   437  * \sa SDL_SelectVideoDisplay()
   438  */
   439 extern DECLSPEC int SDLCALL SDL_GetCurrentVideoDisplay(void);
   440 
   441 /**
   442  * \fn int SDL_GetNumDisplayModes(void)
   443  *
   444  * \brief Returns the number of available display modes for the current display.
   445  *
   446  * \sa SDL_GetDisplayMode()
   447  */
   448 extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(void);
   449 
   450 /**
   451  * \fn int SDL_GetDisplayMode(int index, SDL_DisplayMode *mode)
   452  *
   453  * \brief Fill in information about a specific display mode.
   454  *
   455  * \note The display modes are sorted in this priority:
   456  *       \li bits per pixel -> more colors to fewer colors
   457  *       \li width -> largest to smallest
   458  *       \li height -> largest to smallest
   459  *       \li refresh rate -> highest to lowest
   460  *
   461  * \sa SDL_GetNumDisplayModes()
   462  */
   463 extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int index,
   464                                                SDL_DisplayMode * mode);
   465 
   466 /**
   467  * \fn int SDL_GetDesktopDisplayMode(SDL_DisplayMode *mode)
   468  *
   469  * \brief Fill in information about the desktop display mode for the current display.
   470  */
   471 extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(SDL_DisplayMode * mode);
   472 
   473 /**
   474  * \fn int SDL_GetCurrentDisplayMode(SDL_DisplayMode *mode)
   475  *
   476  * \brief Fill in information about the current display mode.
   477  */
   478 extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(SDL_DisplayMode * mode);
   479 
   480 /**
   481  * \fn SDL_DisplayMode *SDL_GetClosestDisplayMode(const SDL_DisplayMode *mode, SDL_DisplayMode *closest)
   482  *
   483  * \brief Get the closest match to the requested display mode.
   484  *
   485  * \param mode The desired display mode
   486  * \param closest A pointer to a display mode to be filled in with the closest match of the available display modes.
   487  *
   488  * \return The passed in value 'closest', or NULL if no matching video mode was available.
   489  *
   490  * The available display modes are scanned, and 'closest' is filled in with the closest mode matching the requested mode and returned.  The mode format and refresh_rate default to the desktop mode if they are 0.  The modes are scanned with size being first priority, format being second priority, and finally checking the refresh_rate.  If all the available modes are too small, then NULL is returned.
   491  *
   492  * \sa SDL_GetNumDisplayModes()
   493  * \sa SDL_GetDisplayMode()
   494  */
   495 extern DECLSPEC SDL_DisplayMode *SDLCALL SDL_GetClosestDisplayMode(const
   496                                                                    SDL_DisplayMode
   497                                                                    * mode,
   498                                                                    SDL_DisplayMode
   499                                                                    * closest);
   500 
   501 /**
   502  * \fn int SDL_SetFullscreenDisplayMode(const SDL_DisplayMode *mode)
   503  *
   504  * \brief Set the display mode used when a fullscreen window is visible
   505  *        on the currently selected display.
   506  *
   507  * \param mode The mode to use, or NULL for the desktop mode.
   508  *
   509  * \return 0 on success, or -1 if setting the display mode failed.
   510  *
   511  * \sa SDL_SetWindowFullscreen()
   512  */
   513 extern DECLSPEC int SDLCALL SDL_SetFullscreenDisplayMode(const SDL_DisplayMode
   514                                                          * mode);
   515 
   516 /**
   517  * \fn int SDL_GetFullscreenDisplayMode(SDL_DisplayMode *mode)
   518  *
   519  * \brief Fill in information about the display mode used when a fullscreen
   520  *        window is visible on the currently selected display.
   521  */
   522 extern DECLSPEC int SDLCALL SDL_GetFullscreenDisplayMode(SDL_DisplayMode *
   523                                                          mode);
   524 
   525 /**
   526  * \fn int SDL_SetDisplayPalette(const SDL_Color *colors, int firstcolor, int ncolors)
   527  *
   528  * \brief Set the palette entries for indexed display modes.
   529  *
   530  * \return 0 on success, or -1 if the display mode isn't palettized or the colors couldn't be set.
   531  */
   532 extern DECLSPEC int SDLCALL SDL_SetDisplayPalette(const SDL_Color * colors,
   533                                                   int firstcolor,
   534                                                   int ncolors);
   535 
   536 /**
   537  * \fn int SDL_GetDisplayPalette(SDL_Color *colors, int firstcolor, int ncolors)
   538  *
   539  * \brief Gets the palette entries for indexed display modes.
   540  *
   541  * \return 0 on success, or -1 if the display mode isn't palettized
   542  */
   543 extern DECLSPEC int SDLCALL SDL_GetDisplayPalette(SDL_Color * colors,
   544                                                   int firstcolor,
   545                                                   int ncolors);
   546 
   547 /**
   548  * \fn int SDL_SetGamma(float red, float green, float blue)
   549  *
   550  * \brief Set the gamma correction for each of the color channels on the currently selected display.
   551  *
   552  * \return 0 on success, or -1 if setting the gamma isn't supported.
   553  *
   554  * \sa SDL_SetGammaRamp()
   555  */
   556 extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue);
   557 
   558 /**
   559  * \fn int SDL_SetGammaRamp(const Uint16 * red, const Uint16 * green, const Uint16 * blue)
   560  *
   561  * \brief Set the gamma ramp for the currently selected display.
   562  *
   563  * \param red The translation table for the red channel, or NULL
   564  * \param green The translation table for the green channel, or NULL
   565  * \param blue The translation table for the blue channel, or NULL
   566  *
   567  * \return 0 on success, or -1 if gamma ramps are unsupported.
   568  *
   569  * Set the gamma translation table for the red, green, and blue channels
   570  * of the video hardware.  Each table is an array of 256 16-bit quantities,
   571  * representing a mapping between the input and output for that channel.
   572  * The input is the index into the array, and the output is the 16-bit
   573  * gamma value at that index, scaled to the output color precision.
   574  * 
   575  * \sa SDL_GetGammaRamp()
   576  */
   577 extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 * red,
   578                                              const Uint16 * green,
   579                                              const Uint16 * blue);
   580 
   581 /**
   582  * \fn int SDL_GetGammaRamp(Uint16 * red, Uint16 * green, Uint16 * blue)
   583  *
   584  * \brief Get the gamma ramp for the currently selected display.
   585  *
   586  * \param red A pointer to a 256 element array of 16-bit quantities to hold the translation table for the red channel, or NULL.
   587  * \param green A pointer to a 256 element array of 16-bit quantities to hold the translation table for the green channel, or NULL.
   588  * \param blue A pointer to a 256 element array of 16-bit quantities to hold the translation table for the blue channel, or NULL.
   589  * 
   590  * \return 0 on success, or -1 if gamma ramps are unsupported.
   591  *
   592  * \sa SDL_SetGammaRamp()
   593  */
   594 extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 * red, Uint16 * green,
   595                                              Uint16 * blue);
   596 
   597 
   598 /**
   599  * \fn SDL_WindowID SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
   600  *
   601  * \brief Create a window with the specified position, dimensions, and flags.
   602  *
   603  * \param title The title of the window, in UTF-8 encoding
   604  * \param x The x position of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED
   605  * \param y The y position of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED
   606  * \param w The width of the window
   607  * \param h The height of the window
   608  * \param flags The flags for the window, a mask of any of the following: SDL_WINDOW_FULLSCREEN, SDL_WINDOW_OPENGL, SDL_WINDOW_SHOWN, SDL_WINDOW_BORDERLESS, SDL_WINDOW_RESIZABLE, SDL_WINDOW_MAXIMIZED, SDL_WINDOW_MINIMIZED, SDL_WINDOW_INPUT_GRABBED
   609  *
   610  * \return The id of the window created, or zero if window creation failed.
   611  *
   612  * \sa SDL_DestroyWindow()
   613  */
   614 extern DECLSPEC SDL_WindowID SDLCALL SDL_CreateWindow(const char *title,
   615                                                       int x, int y, int w,
   616                                                       int h, Uint32 flags);
   617 
   618 /**
   619  * \fn SDL_WindowID SDL_CreateWindowFrom(void *data)
   620  *
   621  * \brief Create an SDL window struct from an existing native window.
   622  *
   623  * \param data A pointer to driver-dependent window creation data
   624  *
   625  * \return The id of the window created, or zero if window creation failed.
   626  *
   627  * \warning This function is NOT SUPPORTED, use at your own risk!
   628  *
   629  * \sa SDL_DestroyWindow()
   630  */
   631 extern DECLSPEC SDL_WindowID SDLCALL SDL_CreateWindowFrom(const void *data);
   632 
   633 /**
   634  * \fn Uint32 SDL_GetWindowFlags(SDL_WindowID windowID)
   635  *
   636  * \brief Get the window flags.
   637  */
   638 extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_WindowID windowID);
   639 
   640 /**
   641  * \fn void SDL_SetWindowTitle(SDL_WindowID windowID, const char *title)
   642  *
   643  * \brief Set the title of the window, in UTF-8 format.
   644  *
   645  * \sa SDL_GetWindowTitle()
   646  */
   647 extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_WindowID windowID,
   648                                                 const char *title);
   649 
   650 /**
   651  * \fn const char *SDL_GetWindowTitle(SDL_WindowID windowID)
   652  *
   653  * \brief Get the title of the window, in UTF-8 format.
   654  *
   655  * \sa SDL_SetWindowTitle()
   656  */
   657 extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_WindowID windowID);
   658 
   659 /**
   660  * \fn void SDL_SetWindowIcon(SDL_Surface *icon)
   661  *
   662  * \brief Set the icon of the window.
   663  *
   664  * \param icon The icon for the window
   665  *
   666  * FIXME: The icon needs to be set before the window is first shown.  Should some icon representation be part of the window creation data?
   667  */
   668 extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_Surface * icon);
   669 
   670 /**
   671  * \fn void SDL_SetWindowData(SDL_WindowID windowID, void *userdata)
   672  *
   673  * \brief Associate an arbitrary pointer with the window.
   674  *
   675  * \sa SDL_GetWindowData()
   676  */
   677 extern DECLSPEC void SDLCALL SDL_SetWindowData(SDL_WindowID windowID,
   678                                                void *userdata);
   679 
   680 /**
   681  * \fn void *SDL_GetWindowData(SDL_WindowID windowID)
   682  *
   683  * \brief Retrieve the data pointer associated with the window.
   684  *
   685  * \sa SDL_SetWindowData()
   686  */
   687 extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_WindowID windowID);
   688 
   689 /**
   690  * \fn void SDL_SetWindowPosition(SDL_WindowID windowID, int x, int y)
   691  *
   692  * \brief Set the position of the window.
   693  *
   694  * \param windowID The window to reposition
   695  * \param x The x coordinate of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED
   696  * \param y The y coordinate of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED
   697  *
   698  * \note The window coordinate origin is the upper left of the display.
   699  *
   700  * \sa SDL_GetWindowPosition()
   701  */
   702 extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_WindowID windowID,
   703                                                    int x, int y);
   704 
   705 /**
   706  * \fn void SDL_GetWindowPosition(SDL_WindowID windowID, int *x, int *y)
   707  *
   708  * \brief Get the position of the window.
   709  *
   710  * \sa SDL_SetWindowPosition()
   711  */
   712 extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_WindowID windowID,
   713                                                    int *x, int *y);
   714 
   715 /**
   716  * \fn void SDL_SetWindowSize(SDL_WindowID windowID, int w, int w)
   717  *
   718  * \brief Set the size of the window's client area.
   719  *
   720  * \note You can't change the size of a fullscreen window, it automatically
   721  * matches the size of the display mode.
   722  *
   723  * \sa SDL_GetWindowSize()
   724  */
   725 extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_WindowID windowID, int w,
   726                                                int h);
   727 
   728 /**
   729  * \fn void SDL_GetWindowSize(SDL_WindowID windowID, int *w, int *w)
   730  *
   731  * \brief Get the size of the window's client area.
   732  *
   733  * \sa SDL_SetWindowSize()
   734  */
   735 extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_WindowID windowID, int *w,
   736                                                int *h);
   737 
   738 /**
   739  * \fn void SDL_ShowWindow(SDL_WindowID windowID)
   740  *
   741  * \brief Show the window
   742  *
   743  * \sa SDL_HideWindow()
   744  */
   745 extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_WindowID windowID);
   746 
   747 /**
   748  * \fn void SDL_HideWindow(SDL_WindowID windowID)
   749  *
   750  * \brief Hide the window
   751  *
   752  * \sa SDL_ShowWindow()
   753  */
   754 extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_WindowID windowID);
   755 
   756 /**
   757  * \fn void SDL_RaiseWindow(SDL_WindowID windowID)
   758  *
   759  * \brief Raise the window above other windows and set the input focus.
   760  */
   761 extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_WindowID windowID);
   762 
   763 /**
   764  * \fn void SDL_MaximizeWindow(SDL_WindowID windowID)
   765  *
   766  * \brief Make the window as large as possible.
   767  *
   768  * \sa SDL_RestoreWindow()
   769  */
   770 extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_WindowID windowID);
   771 
   772 /**
   773  * \fn void SDL_MinimizeWindow(SDL_WindowID windowID)
   774  *
   775  * \brief Minimize the window to an iconic representation.
   776  *
   777  * \sa SDL_RestoreWindow()
   778  */
   779 extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_WindowID windowID);
   780 
   781 /**
   782  * \fn void SDL_RestoreWindow(SDL_WindowID windowID)
   783  *
   784  * \brief Restore the size and position of a minimized or maximized window.
   785  *
   786  * \sa SDL_MaximizeWindow()
   787  * \sa SDL_MinimizeWindow()
   788  */
   789 extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_WindowID windowID);
   790 
   791 /**
   792  * \fn int SDL_SetWindowFullscreen(SDL_WindowID windowID, int fullscreen)
   793  *
   794  * \brief Set the window's fullscreen state.
   795  *
   796  * \return 0 on success, or -1 if setting the display mode failed.
   797  *
   798  * \sa SDL_SetFullscreenDisplayMode()
   799  */
   800 extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_WindowID windowID,
   801                                                     int fullscreen);
   802 
   803 /**
   804  * \fn void SDL_SetWindowGrab(SDL_WindowID windowID, int mode)
   805  *
   806  * \brief Set the window's input grab mode.
   807  *
   808  * \param mode This is 1 to grab input, and 0 to release input.
   809  *
   810  * \sa SDL_GetWindowGrab()
   811  */
   812 extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_WindowID windowID,
   813                                                int mode);
   814 
   815 /**
   816  * \fn int SDL_GetWindowGrab(SDL_WindowID windowID)
   817  *
   818  * \brief Get the window's input grab mode.
   819  *
   820  * \return This returns 1 if input is grabbed, and 0 otherwise.
   821  *
   822  * \sa SDL_SetWindowGrab()
   823  */
   824 extern DECLSPEC int SDLCALL SDL_GetWindowGrab(SDL_WindowID windowID);
   825 
   826 /**
   827  * \fn SDL_bool SDL_GetWindowWMInfo(SDL_WindowID windowID, struct SDL_SysWMinfo * info)
   828  *
   829  * \brief Get driver specific information about a window.
   830  *
   831  * \note Include SDL_syswm.h for the declaration of SDL_SysWMinfo.
   832  */
   833 struct SDL_SysWMinfo;
   834 extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_WindowID windowID,
   835                                                      struct SDL_SysWMinfo
   836                                                      *info);
   837 
   838 /**
   839  * \fn void SDL_DestroyWindow(SDL_WindowID windowID)
   840  *
   841  * \brief Destroy a window.
   842  */
   843 extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_WindowID windowID);
   844 
   845 /**
   846  * \fn int SDL_GetNumRenderDrivers(void)
   847  *
   848  * \brief Get the number of 2D rendering drivers available for the current display.
   849  *
   850  * A render driver is a set of code that handles rendering and texture
   851  * management on a particular display.  Normally there is only one, but
   852  * some drivers may have several available with different capabilities.
   853  *
   854  * \sa SDL_GetRenderDriverInfo()
   855  * \sa SDL_CreateRenderer()
   856  */
   857 extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
   858 
   859 /**
   860  * \fn int SDL_GetRenderDriverInfo(int index, SDL_RendererInfo *info)
   861  *
   862  * \brief Get information about a specific 2D rendering driver for the current display.
   863  *
   864  * \param index The index of the driver to query information about.
   865  * \param info A pointer to an SDL_RendererInfo struct to be filled with information on the rendering driver.
   866  *
   867  * \return 0 on success, -1 if the index was out of range
   868  *
   869  * \sa SDL_CreateRenderer()
   870  */
   871 extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index,
   872                                                     SDL_RendererInfo * info);
   873 
   874 /**
   875  * \fn int SDL_CreateRenderer(SDL_WindowID window, int index, Uint32 flags)
   876  *
   877  * \brief Create and make active a 2D rendering context for a window.
   878  *
   879  * \param windowID The window used for rendering
   880  * \param index The index of the rendering driver to initialize, or -1 to initialize the first one supporting the requested flags.
   881  * \param flags SDL_RendererFlags
   882  *
   883  * \return 0 on success, -1 if the flags were not supported, or -2 if
   884  *         there isn't enough memory to support the requested flags
   885  *
   886  * \sa SDL_SelectRenderer()
   887  * \sa SDL_GetRendererInfo()
   888  * \sa SDL_DestroyRenderer()
   889  */
   890 extern DECLSPEC int SDLCALL SDL_CreateRenderer(SDL_WindowID windowID,
   891                                                int index, Uint32 flags);
   892 
   893 /**
   894  * \fn int SDL_SelectRenderer(SDL_WindowID windowID)
   895  *
   896  * \brief Select the rendering context for a particular window.
   897  *
   898  * \return 0 on success, -1 if the selected window doesn't have a
   899  *         rendering context.
   900  */
   901 extern DECLSPEC int SDLCALL SDL_SelectRenderer(SDL_WindowID windowID);
   902 
   903 /**
   904  * \fn int SDL_GetRendererInfo(SDL_RendererInfo *info)
   905  *
   906  * \brief Get information about the current rendering context.
   907  */
   908 extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_RendererInfo * info);
   909 
   910 /**
   911  * \fn SDL_TextureID SDL_CreateTexture(Uint32 format, int access, int w, int h)
   912  *
   913  * \brief Create a texture for the current rendering context.
   914  *
   915  * \param format The format of the texture
   916  * \param access One of the enumerated values in SDL_TextureAccess
   917  * \param w The width of the texture in pixels
   918  * \param h The height of the texture in pixels
   919  *
   920  * \return The created texture is returned, or 0 if no rendering context was active,  the format was unsupported, or the width or height were out of range.
   921  *
   922  * \sa SDL_QueryTexture()
   923  * \sa SDL_DestroyTexture()
   924  */
   925 extern DECLSPEC SDL_TextureID SDLCALL SDL_CreateTexture(Uint32 format,
   926                                                         int access, int w,
   927                                                         int h);
   928 
   929 /**
   930  * \fn SDL_TextureID SDL_CreateTextureFromSurface(Uint32 format, int access, SDL_Surface *surface)
   931  *
   932  * \brief Create a texture from an existing surface.
   933  *
   934  * \param format The format of the texture, or 0 to pick an appropriate format
   935  * \param access One of the enumerated values in SDL_TextureAccess
   936  * \param surface The surface containing pixel data used to fill the texture
   937  *
   938  * \return The created texture is returned, or 0 if no rendering context was active,  the format was unsupported, or the surface width or height were out of range.
   939  *
   940  * \note The surface is not modified or freed by this function.
   941  *
   942  * \sa SDL_QueryTexture()
   943  * \sa SDL_DestroyTexture()
   944  */
   945 extern DECLSPEC SDL_TextureID SDLCALL SDL_CreateTextureFromSurface(Uint32
   946                                                                    format,
   947                                                                    int access,
   948                                                                    SDL_Surface
   949                                                                    * surface);
   950 
   951 /**
   952  * \fn int SDL_QueryTexture(SDL_TextureID textureID, Uint32 *format, int *access, int *w, int *h)
   953  *
   954  * \brief Query the attributes of a texture
   955  *
   956  * \param texture A texture to be queried
   957  * \param format A pointer filled in with the raw format of the texture.  The actual format may differ, but pixel transfers will use this format.
   958  * \param access A pointer filled in with the actual access to the texture.
   959  * \param w A pointer filled in with the width of the texture in pixels
   960  * \param h A pointer filled in with the height of the texture in pixels
   961  *
   962  * \return 0 on success, or -1 if the texture is not valid
   963  */
   964 extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_TextureID textureID,
   965                                              Uint32 * format, int *access,
   966                                              int *w, int *h);
   967 
   968 /**
   969  * \fn int SDL_QueryTexturePixels(SDL_TextureID textureID, void **pixels, int pitch)
   970  *
   971  * \brief Query the pixels of a texture, if the texture does not need to be locked for pixel access.
   972  *
   973  * \param texture A texture to be queried, which was created with SDL_TEXTUREACCESS_LOCAL
   974  * \param pixels A pointer filled with a pointer to the pixels for the texture 
   975  * \param pitch A pointer filled in with the pitch of the pixel data
   976  *
   977  * \return 0 on success, or -1 if the texture is not valid, or must be locked for pixel access.
   978  */
   979 extern DECLSPEC int SDLCALL SDL_QueryTexturePixels(SDL_TextureID textureID,
   980                                                    void **pixels, int *pitch);
   981 
   982 /**
   983  * \fn int SDL_SetTexturePalette(SDL_TextureID textureID, const SDL_Color * colors, int firstcolor, int ncolors)
   984  *
   985  * \brief Update an indexed texture with a color palette
   986  *
   987  * \param texture The texture to update
   988  * \param colors The array of RGB color data
   989  * \param firstcolor The first index to update
   990  * \param ncolors The number of palette entries to fill with the color data
   991  *
   992  * \return 0 on success, or -1 if the texture is not valid or not an indexed texture
   993  */
   994 extern DECLSPEC int SDLCALL SDL_SetTexturePalette(SDL_TextureID textureID,
   995                                                   const SDL_Color * colors,
   996                                                   int firstcolor,
   997                                                   int ncolors);
   998 
   999 /**
  1000  * \fn int SDL_GetTexturePalette(SDL_TextureID textureID, SDL_Color * colors, int firstcolor, int ncolors)
  1001  *
  1002  * \brief Update an indexed texture with a color palette
  1003  *
  1004  * \param texture The texture to update
  1005  * \param colors The array to fill with RGB color data
  1006  * \param firstcolor The first index to retrieve
  1007  * \param ncolors The number of palette entries to retrieve
  1008  *
  1009  * \return 0 on success, or -1 if the texture is not valid or not an indexed texture
  1010  */
  1011 extern DECLSPEC int SDLCALL SDL_GetTexturePalette(SDL_TextureID textureID,
  1012                                                   SDL_Color * colors,
  1013                                                   int firstcolor,
  1014                                                   int ncolors);
  1015 
  1016 /**
  1017  * \fn int SDL_SetTextureColorMod(SDL_TextureID textureID, Uint8 r, Uint8 g, Uint8 b)
  1018  *
  1019  * \brief Set an additional color value used in render copy operations
  1020  *
  1021  * \param texture The texture to update
  1022  * \param r The red source color value multiplied into copy operations
  1023  * \param g The green source color value multiplied into copy operations
  1024  * \param b The blue source color value multiplied into copy operations
  1025  *
  1026  * \return 0 on success, or -1 if the texture is not valid or color modulation is not supported
  1027  *
  1028  * \sa SDL_GetTextureColorMod()
  1029  */
  1030 extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_TextureID textureID,
  1031                                                    Uint8 r, Uint8 g, Uint8 b);
  1032 
  1033 
  1034 /**
  1035  * \fn int SDL_GetTextureColorMod(SDL_TextureID textureID, Uint8 *r, Uint8 *g, Uint8 *b)
  1036  *
  1037  * \brief Get the additional color value used in render copy operations
  1038  *
  1039  * \param texture The texture to query
  1040  * \param r A pointer filled in with the source red color value
  1041  * \param g A pointer filled in with the source green color value
  1042  * \param b A pointer filled in with the source blue color value
  1043  *
  1044  * \return 0 on success, or -1 if the texture is not valid
  1045  *
  1046  * \sa SDL_SetTextureColorMod()
  1047  */
  1048 extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_TextureID textureID,
  1049                                                    Uint8 * r, Uint8 * g,
  1050                                                    Uint8 * b);
  1051 
  1052 /**
  1053  * \fn int SDL_SetTextureAlphaMod(SDL_TextureID textureID, Uint8 alpha)
  1054  *
  1055  * \brief Set an additional alpha value used in render copy operations
  1056  *
  1057  * \param texture The texture to update
  1058  * \param alpha The source alpha value multiplied into copy operations.
  1059  *
  1060  * \return 0 on success, or -1 if the texture is not valid or alpha modulation is not supported
  1061  *
  1062  * \sa SDL_GetTextureAlphaMod()
  1063  */
  1064 extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_TextureID textureID,
  1065                                                    Uint8 alpha);
  1066 
  1067 /**
  1068  * \fn int SDL_GetTextureAlphaMod(SDL_TextureID textureID, Uint8 *alpha)
  1069  *
  1070  * \brief Get the additional alpha value used in render copy operations
  1071  *
  1072  * \param texture The texture to query
  1073  * \param alpha A pointer filled in with the source alpha value
  1074  *
  1075  * \return 0 on success, or -1 if the texture is not valid
  1076  *
  1077  * \sa SDL_SetTextureAlphaMod()
  1078  */
  1079 extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_TextureID textureID,
  1080                                                    Uint8 * alpha);
  1081 
  1082 /**
  1083  * \fn int SDL_SetTextureBlendMode(SDL_TextureID textureID, int blendMode)
  1084  *
  1085  * \brief Set the blend mode used for texture copy operations
  1086  *
  1087  * \param texture The texture to update
  1088  * \param blendMode SDL_TextureBlendMode to use for texture blending
  1089  *
  1090  * \return 0 on success, or -1 if the texture is not valid or the blend mode is not supported
  1091  *
  1092  * \note If the blend mode is not supported, the closest supported mode is chosen.
  1093  *
  1094  * \sa SDL_GetTextureBlendMode()
  1095  */
  1096 extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_TextureID textureID,
  1097                                                     int blendMode);
  1098 
  1099 /**
  1100  * \fn int SDL_GetTextureBlendMode(SDL_TextureID textureID, int *blendMode)
  1101  *
  1102  * \brief Get the blend mode used for texture copy operations
  1103  *
  1104  * \param texture The texture to query
  1105  * \param blendMode A pointer filled in with the current blend mode
  1106  *
  1107  * \return 0 on success, or -1 if the texture is not valid
  1108  *
  1109  * \sa SDL_SetTextureBlendMode()
  1110  */
  1111 extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_TextureID textureID,
  1112                                                     int *blendMode);
  1113 
  1114 /**
  1115  * \fn int SDL_SetTextureScaleMode(SDL_TextureID textureID, int scaleMode)
  1116  *
  1117  * \brief Set the scale mode used for texture copy operations
  1118  *
  1119  * \param texture The texture to update
  1120  * \param scaleMode SDL_TextureScaleMode to use for texture scaling
  1121  *
  1122  * \return 0 on success, or -1 if the texture is not valid or the scale mode is not supported
  1123  *
  1124  * \note If the scale mode is not supported, the closest supported mode is chosen.
  1125  *
  1126  * \sa SDL_GetTextureScaleMode()
  1127  */
  1128 extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_TextureID textureID,
  1129                                                     int scaleMode);
  1130 
  1131 /**
  1132  * \fn int SDL_GetTextureScaleMode(SDL_TextureID textureID, int *scaleMode)
  1133  *
  1134  * \brief Get the scale mode used for texture copy operations
  1135  *
  1136  * \param texture The texture to query
  1137  * \param scaleMode A pointer filled in with the current scale mode
  1138  *
  1139  * \return 0 on success, or -1 if the texture is not valid
  1140  *
  1141  * \sa SDL_SetTextureScaleMode()
  1142  */
  1143 extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_TextureID textureID,
  1144                                                     int *scaleMode);
  1145 
  1146 /**
  1147  * \fn int SDL_UpdateTexture(SDL_TextureID textureID, const SDL_Rect *rect, const void *pixels, int pitch)
  1148  *
  1149  * \brief Update the given texture rectangle with new pixel data.
  1150  *
  1151  * \param texture The texture to update
  1152  * \param rect A pointer to the rectangle of pixels to update, or NULL to update the entire texture.
  1153  * \param pixels The raw pixel data
  1154  * \param pitch The number of bytes between rows of pixel data
  1155  *
  1156  * \return 0 on success, or -1 if the texture is not valid
  1157  *
  1158  * \note This is a very slow function for textures not created with SDL_TEXTUREACCESS_LOCAL.
  1159  */
  1160 extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_TextureID textureID,
  1161                                               const SDL_Rect * rect,
  1162                                               const void *pixels, int pitch);
  1163 
  1164 /**
  1165  * \fn void SDL_LockTexture(SDL_TextureID textureID, const SDL_Rect *rect, int markDirty, void **pixels, int *pitch)
  1166  *
  1167  * \brief Lock a portion of the texture for pixel access.
  1168  *
  1169  * \param texture The texture to lock for access, which must have been created with SDL_TEXTUREACCESS_LOCAL.
  1170  * \param rect A pointer to the rectangle to lock for access. If the rect is NULL, the entire texture will be locked.
  1171  * \param markDirty If this is nonzero, the locked area will be marked dirty when the texture is unlocked.
  1172  * \param pixels This is filled in with a pointer to the locked pixels, appropriately offset by the locked area.
  1173  * \param pitch This is filled in with the pitch of the locked pixels.
  1174  *
  1175  * \return 0 on success, or -1 if the texture is not valid or was created with SDL_TEXTUREACCESS_REMOTe
  1176  *
  1177  * \sa SDL_DirtyTexture()
  1178  * \sa SDL_UnlockTexture()
  1179  */
  1180 extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_TextureID textureID,
  1181                                             const SDL_Rect * rect,
  1182                                             int markDirty, void **pixels,
  1183                                             int *pitch);
  1184 
  1185 /**
  1186  * \fn void SDL_UnlockTexture(SDL_TextureID textureID)
  1187  *
  1188  * \brief Unlock a texture, uploading the changes to video memory, if needed.
  1189  *
  1190  * \sa SDL_LockTexture()
  1191  * \sa SDL_DirtyTexture()
  1192  */
  1193 extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_TextureID textureID);
  1194 
  1195 /**
  1196  * \fn void SDL_DirtyTexture(SDL_TextureID textureID, int numrects, const SDL_Rect * rects)
  1197  *
  1198  * \brief Mark the specified rectangles of the texture as dirty.
  1199  *
  1200  * \note The texture must have been created with SDL_TEXTUREACCESS_LOCAL.
  1201  *
  1202  * \sa SDL_LockTexture()
  1203  * \sa SDL_UnlockTexture()
  1204  */
  1205 extern DECLSPEC void SDLCALL SDL_DirtyTexture(SDL_TextureID textureID,
  1206                                               int numrects,
  1207                                               const SDL_Rect * rects);
  1208 
  1209 /**
  1210  * \fn void SDL_RenderFill(Uint8 r, Uint8 g, Uint8 b, Uint8 a, const SDL_Rect *rect)
  1211  *
  1212  * \brief Fill the current rendering target with the specified color.
  1213  *
  1214  * \param r The red value used to fill the rendering target
  1215  * \param g The green value used to fill the rendering target
  1216  * \param b The blue value used to fill the rendering target
  1217  * \param a The alpha value used to fill the rendering target, usually SDL_ALPHA_OPAQUE (255)
  1218  * \param rect A pointer to the destination rectangle, or NULL for the entire rendering target.
  1219  *
  1220  * \return 0 on success, or -1 if there is no rendering context current
  1221  */
  1222 extern DECLSPEC int SDLCALL SDL_RenderFill(Uint8 r, Uint8 g, Uint8 b, Uint8 a,
  1223                                            const SDL_Rect * rect);
  1224 
  1225 /**
  1226  * \fn int SDL_RenderCopy(SDL_TextureID textureID, const SDL_Rect *srcrect, const SDL_Rect *dstrect)
  1227  *
  1228  * \brief Copy a portion of the texture to the current rendering target.
  1229  *
  1230  * \param texture The source texture.
  1231  * \param srcrect A pointer to the source rectangle, or NULL for the entire texture.
  1232  * \param dstrect A pointer to the destination rectangle, or NULL for the entire rendering target.
  1233  *
  1234  * \return 0 on success, or -1 if there is no rendering context current, or the driver doesn't support the requested operation.
  1235  */
  1236 extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_TextureID textureID,
  1237                                            const SDL_Rect * srcrect,
  1238                                            const SDL_Rect * dstrect);
  1239 
  1240 /**
  1241  * \fn int SDL_RenderReadPixels(const SDL_Rect *rect, void *pixels, int pitch)
  1242  *
  1243  * \brief Read pixels from the current rendering target.
  1244  *
  1245  * \param rect A pointer to the rectangle to read, or NULL for the entire render target
  1246  * \param pixels A pointer to be filled in with the pixel data
  1247  * \param pitch The pitch of the pixels parameter
  1248  *
  1249  * \return 0 on success, or -1 if pixel reading is not supported.
  1250  *
  1251  * \warning This is a very slow operation, and should not be used frequently.
  1252  */
  1253 extern DECLSPEC int SDLCALL SDL_RenderReadPixels(const SDL_Rect * rect,
  1254                                                  void *pixels, int pitch);
  1255 
  1256 /**
  1257  * \fn int SDL_RenderWritePixels(const SDL_Rect *rect, const void *pixels, int pitch)
  1258  *
  1259  * \brief Write pixels to the current rendering target.
  1260  *
  1261  * \param rect A pointer to the rectangle to write, or NULL for the entire render target
  1262  * \param pixels A pointer to the pixel data to write
  1263  * \param pitch The pitch of the pixels parameter
  1264  *
  1265  * \return 0 on success, or -1 if pixel writing is not supported.
  1266  *
  1267  * \warning This is a very slow operation, and should not be used frequently.
  1268  */
  1269 extern DECLSPEC int SDLCALL SDL_RenderWritePixels(const SDL_Rect * rect,
  1270                                                   const void *pixels,
  1271                                                   int pitch);
  1272 
  1273 /**
  1274  * \fn void SDL_RenderPresent(void)
  1275  *
  1276  * \brief Update the screen with rendering performed.
  1277  */
  1278 extern DECLSPEC void SDLCALL SDL_RenderPresent(void);
  1279 
  1280 /**
  1281  * \fn void SDL_DestroyTexture(SDL_TextureID textureID);
  1282  *
  1283  * \brief Destroy the specified texture.
  1284  *
  1285  * \sa SDL_CreateTexture()
  1286  * \sa SDL_CreateTextureFromSurface()
  1287  */
  1288 extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_TextureID textureID);
  1289 
  1290 /**
  1291  * \fn void SDL_DestroyRenderer(SDL_WindowID windowID);
  1292  *
  1293  * \brief Destroy the rendering context for a window and free associated
  1294  *        textures.
  1295  *
  1296  * \sa SDL_CreateRenderer()
  1297  */
  1298 extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_WindowID windowID);
  1299 
  1300 /*
  1301  * Maps an RGB triple to an opaque pixel value for a given pixel format
  1302  */
  1303 extern DECLSPEC Uint32 SDLCALL SDL_MapRGB
  1304     (SDL_PixelFormat * format, Uint8 r, Uint8 g, Uint8 b);
  1305 
  1306 /*
  1307  * Maps an RGBA quadruple to a pixel value for a given pixel format
  1308  */
  1309 extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(SDL_PixelFormat * format,
  1310                                            Uint8 r, Uint8 g, Uint8 b,
  1311                                            Uint8 a);
  1312 
  1313 /*
  1314  * Maps a pixel value into the RGB components for a given pixel format
  1315  */
  1316 extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, SDL_PixelFormat * fmt,
  1317                                         Uint8 * r, Uint8 * g, Uint8 * b);
  1318 
  1319 /*
  1320  * Maps a pixel value into the RGBA components for a given pixel format
  1321  */
  1322 extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, SDL_PixelFormat * fmt,
  1323                                          Uint8 * r, Uint8 * g, Uint8 * b,
  1324                                          Uint8 * a);
  1325 
  1326 /*
  1327  * Allocate and free an RGB surface (must be called after SDL_SetVideoMode)
  1328  * If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
  1329  * If the depth is greater than 8 bits, the pixel format is set using the
  1330  * flags '[RGB]mask'.
  1331  * If the function runs out of memory, it will return NULL.
  1332  *
  1333  * The 'flags' tell what kind of surface to create.
  1334  * SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits.
  1335  * SDL_SRCALPHA means that the surface will be used for alpha blits.
  1336  */
  1337 extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface
  1338     (Uint32 flags, int width, int height, int depth,
  1339      Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
  1340 extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
  1341                                                               int width,
  1342                                                               int height,
  1343                                                               int depth,
  1344                                                               int pitch,
  1345                                                               Uint32 Rmask,
  1346                                                               Uint32 Gmask,
  1347                                                               Uint32 Bmask,
  1348                                                               Uint32 Amask);
  1349 extern DECLSPEC SDL_Surface *SDLCALL
  1350 SDL_CreateRGBSurfaceFromTexture(SDL_TextureID textureID);
  1351 extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface);
  1352 
  1353 /**
  1354  * \fn int SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette)
  1355  *
  1356  * \brief Set the palette used by a surface.
  1357  *
  1358  * \return 0, or -1 if the surface format doesn't use a palette.
  1359  *
  1360  * \note A single palette can be shared with many surfaces.
  1361  */
  1362 extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface,
  1363                                                   SDL_Palette * palette);
  1364 
  1365 /*
  1366  * SDL_LockSurface() sets up a surface for directly accessing the pixels.
  1367  * Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write
  1368  * to and read from 'surface->pixels', using the pixel format stored in 
  1369  * 'surface->format'.  Once you are done accessing the surface, you should 
  1370  * use SDL_UnlockSurface() to release it.
  1371  *
  1372  * Not all surfaces require locking.  If SDL_MUSTLOCK(surface) evaluates
  1373  * to 0, then you can read and write to the surface at any time, and the
  1374  * pixel format of the surface will not change.
  1375  * 
  1376  * No operating system or library calls should be made between lock/unlock
  1377  * pairs, as critical system locks may be held during this time.
  1378  *
  1379  * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
  1380  */
  1381 extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface);
  1382 extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface);
  1383 
  1384 /*
  1385  * Load a surface from a seekable SDL data source (memory or file.)
  1386  * If 'freesrc' is non-zero, the source will be closed after being read.
  1387  * Returns the new surface, or NULL if there was an error.
  1388  * The new surface should be freed with SDL_FreeSurface().
  1389  */
  1390 extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src,
  1391                                                     int freesrc);
  1392 
  1393 /* Convenience macro -- load a surface from a file */
  1394 #define SDL_LoadBMP(file)	SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
  1395 
  1396 /*
  1397  * Save a surface to a seekable SDL data source (memory or file.)
  1398  * If 'freedst' is non-zero, the source will be closed after being written.
  1399  * Returns 0 if successful or -1 if there was an error.
  1400  */
  1401 extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
  1402     (SDL_Surface * surface, SDL_RWops * dst, int freedst);
  1403 
  1404 /* Convenience macro -- save a surface to a file */
  1405 #define SDL_SaveBMP(surface, file) \
  1406 		SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
  1407 
  1408 /*
  1409  * Sets the color key (transparent pixel) in a blittable surface.
  1410  * If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL), 
  1411  * 'key' will be the transparent pixel in the source image of a blit.
  1412  * SDL_RLEACCEL requests RLE acceleration for the surface if present,
  1413  * and removes RLE acceleration if absent.
  1414  * If 'flag' is 0, this function clears any current color key.
  1415  * This function returns 0, or -1 if there was an error.
  1416  */
  1417 extern DECLSPEC int SDLCALL SDL_SetColorKey
  1418     (SDL_Surface * surface, Uint32 flag, Uint32 key);
  1419 
  1420 /*
  1421  * This function sets the alpha value for the entire surface, as opposed to
  1422  * using the alpha component of each pixel. This value measures the range
  1423  * of transparency of the surface, 0 being completely transparent to 255
  1424  * being completely opaque. An 'alpha' value of 255 causes blits to be
  1425  * opaque, the source pixels copied to the destination (the default). Note
  1426  * that per-surface alpha can be combined with colorkey transparency.
  1427  *
  1428  * If 'flag' is 0, alpha blending is disabled for the surface.
  1429  * If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface.
  1430  * OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the
  1431  * surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed.
  1432  *
  1433  * The 'alpha' parameter is ignored for surfaces that have an alpha channel.
  1434  */
  1435 extern DECLSPEC int SDLCALL SDL_SetAlpha(SDL_Surface * surface, Uint32 flag,
  1436                                          Uint8 alpha);
  1437 
  1438 /*
  1439  * Sets the clipping rectangle for the destination surface in a blit.
  1440  *
  1441  * If the clip rectangle is NULL, clipping will be disabled.
  1442  * If the clip rectangle doesn't intersect the surface, the function will
  1443  * return SDL_FALSE and blits will be completely clipped.  Otherwise the
  1444  * function returns SDL_TRUE and blits to the surface will be clipped to
  1445  * the intersection of the surface area and the clipping rectangle.
  1446  *
  1447  * Note that blits are automatically clipped to the edges of the source
  1448  * and destination surfaces.
  1449  */
  1450 extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface,
  1451                                                  const SDL_Rect * rect);
  1452 
  1453 /*
  1454  * Gets the clipping rectangle for the destination surface in a blit.
  1455  * 'rect' must be a pointer to a valid rectangle which will be filled
  1456  * with the correct values.
  1457  */
  1458 extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface,
  1459                                              SDL_Rect * rect);
  1460 
  1461 /*
  1462  * Creates a new surface of the specified format, and then copies and maps 
  1463  * the given surface to it so the blit of the converted surface will be as 
  1464  * fast as possible.  If this function fails, it returns NULL.
  1465  *
  1466  * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those 
  1467  * semantics.  You can also pass SDL_RLEACCEL in the flags parameter and
  1468  * SDL will try to RLE accelerate colorkey and alpha blits in the resulting
  1469  * surface.
  1470  *
  1471  * This function is used internally by SDL_DisplayFormat().
  1472  */
  1473 extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface
  1474     (SDL_Surface * src, SDL_PixelFormat * fmt, Uint32 flags);
  1475 
  1476 /*
  1477  * This function performs a fast fill of the given rectangle with 'color'
  1478  * The given rectangle is clipped to the destination surface clip area
  1479  * and the final fill rectangle is saved in the passed in pointer.
  1480  * If 'dstrect' is NULL, the whole surface will be filled with 'color'
  1481  * The color should be a pixel of the format used by the surface, and 
  1482  * can be generated by the SDL_MapRGB() function.
  1483  * This function returns 0 on success, or -1 on error.
  1484  */
  1485 extern DECLSPEC int SDLCALL SDL_FillRect
  1486     (SDL_Surface * dst, SDL_Rect * dstrect, Uint32 color);
  1487 
  1488 /*
  1489  * This performs a fast blit from the source surface to the destination
  1490  * surface.  It assumes that the source and destination rectangles are
  1491  * the same size.  If either 'srcrect' or 'dstrect' are NULL, the entire
  1492  * surface (src or dst) is copied.  The final blit rectangles are saved
  1493  * in 'srcrect' and 'dstrect' after all clipping is performed.
  1494  * If the blit is successful, it returns 0, otherwise it returns -1.
  1495  *
  1496  * The blit function should not be called on a locked surface.
  1497  *
  1498  * The blit semantics for surfaces with and without alpha and colorkey
  1499  * are defined as follows:
  1500  *
  1501  * RGBA->RGB:
  1502  *     SDL_SRCALPHA set:
  1503  * 	alpha-blend (using alpha-channel).
  1504  * 	SDL_SRCCOLORKEY ignored.
  1505  *     SDL_SRCALPHA not set:
  1506  * 	copy RGB.
  1507  * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
  1508  * 	RGB values of the source colour key, ignoring alpha in the
  1509  * 	comparison.
  1510  * 
  1511  * RGB->RGBA:
  1512  *     SDL_SRCALPHA set:
  1513  * 	alpha-blend (using the source per-surface alpha value);
  1514  * 	set destination alpha to opaque.
  1515  *     SDL_SRCALPHA not set:
  1516  * 	copy RGB, set destination alpha to source per-surface alpha value.
  1517  *     both:
  1518  * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
  1519  * 	source colour key.
  1520  * 
  1521  * RGBA->RGBA:
  1522  *     SDL_SRCALPHA set:
  1523  * 	alpha-blend (using the source alpha channel) the RGB values;
  1524  * 	leave destination alpha untouched. [Note: is this correct?]
  1525  * 	SDL_SRCCOLORKEY ignored.
  1526  *     SDL_SRCALPHA not set:
  1527  * 	copy all of RGBA to the destination.
  1528  * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
  1529  * 	RGB values of the source colour key, ignoring alpha in the
  1530  * 	comparison.
  1531  * 
  1532  * RGB->RGB: 
  1533  *     SDL_SRCALPHA set:
  1534  * 	alpha-blend (using the source per-surface alpha value).
  1535  *     SDL_SRCALPHA not set:
  1536  * 	copy RGB.
  1537  *     both:
  1538  * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the
  1539  * 	source colour key.
  1540  *
  1541  * If either of the surfaces were in video memory, and the blit returns -2,
  1542  * the video memory was lost, so it should be reloaded with artwork and 
  1543  * re-blitted:
  1544 	while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
  1545 		while ( SDL_LockSurface(image) < 0 )
  1546 			Sleep(10);
  1547 		-- Write image pixels to image->pixels --
  1548 		SDL_UnlockSurface(image);
  1549 	}
  1550  * This happens under DirectX 5.0 when the system switches away from your
  1551  * fullscreen application.  The lock will also fail until you have access
  1552  * to the video memory again.
  1553  */
  1554 /* You should call SDL_BlitSurface() unless you know exactly how SDL
  1555    blitting works internally and how to use the other blit functions.
  1556 */
  1557 #define SDL_BlitSurface SDL_UpperBlit
  1558 
  1559 /* This is the public blit function, SDL_BlitSurface(), and it performs
  1560    rectangle validation and clipping before passing it to SDL_LowerBlit()
  1561 */
  1562 extern DECLSPEC int SDLCALL SDL_UpperBlit
  1563     (SDL_Surface * src, SDL_Rect * srcrect,
  1564      SDL_Surface * dst, SDL_Rect * dstrect);
  1565 /* This is a semi-private blit function and it performs low-level surface
  1566    blitting only.
  1567 */
  1568 extern DECLSPEC int SDLCALL SDL_LowerBlit
  1569     (SDL_Surface * src, SDL_Rect * srcrect,
  1570      SDL_Surface * dst, SDL_Rect * dstrect);
  1571 
  1572 /**
  1573  * \fn int SDL_SoftStretch(SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect)
  1574  *
  1575  * \brief Perform a fast, low quality, stretch blit between two surfaces of the same pixel format.
  1576  *
  1577  * \note This function uses a static buffer, and is not thread-safe.
  1578  */
  1579 extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src,
  1580                                             SDL_Rect * srcrect,
  1581                                             SDL_Surface * dst,
  1582                                             SDL_Rect * dstrect);
  1583 
  1584 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1585 /* OpenGL support functions.                                                 */
  1586 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1587 
  1588 /**
  1589  * \fn int SDL_GL_LoadLibrary(const char *path)
  1590  *
  1591  * \brief Dynamically load an OpenGL library.
  1592  *
  1593  * \param path The platform dependent OpenGL library name, or NULL to open the default OpenGL library
  1594  *
  1595  * \return 0 on success, or -1 if the library couldn't be loaded
  1596  *
  1597  * This should be done after initializing the video driver, but before
  1598  * creating any OpenGL windows.  If no OpenGL library is loaded, the default
  1599  * library will be loaded upon creation of the first OpenGL window.
  1600  *
  1601  * \note If you do this, you need to retrieve all of the GL functions used in
  1602  *       your program from the dynamic library using SDL_GL_GetProcAddress().
  1603  *
  1604  * \sa SDL_GL_GetProcAddress()
  1605  */
  1606 extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);
  1607 
  1608 /**
  1609  * \fn void *SDL_GL_GetProcAddress(const char *proc)
  1610  *
  1611  * \brief Get the address of an OpenGL function.
  1612  */
  1613 extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc);
  1614 
  1615 /**
  1616  * \fn SDL_bool SDL_GL_ExtensionSupported(const char *extension)
  1617  *
  1618  * \brief Return true if an OpenGL extension is supported for the current context.
  1619  */
  1620 extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char
  1621                                                            *extension);
  1622 
  1623 /**
  1624  * \fn int SDL_GL_SetAttribute(SDL_GLattr attr, int value)
  1625  *
  1626  * \brief Set an OpenGL window attribute before window creation.
  1627  */
  1628 extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);
  1629 
  1630 /**
  1631  * \fn int SDL_GL_GetWindowAttribute(SDL_WindowID windowID, SDL_GLattr attr, int *value)
  1632  *
  1633  * \brief Get the actual value for an attribute from the current context.
  1634  */
  1635 extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value);
  1636 
  1637 /**
  1638  * \fn SDL_GLContext SDL_GL_CreateContext(SDL_WindowID windowID)
  1639  *
  1640  * \brief Create an OpenGL context for use with an OpenGL window, and make it current.
  1641  *
  1642  * \sa SDL_GL_DeleteContext()
  1643  */
  1644 extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_WindowID
  1645                                                            windowID);
  1646 
  1647 /**
  1648  * \fn int SDL_GL_MakeCurrent(SDL_WindowID windowID, SDL_GLContext context)
  1649  *
  1650  * \brief Set up an OpenGL context for rendering into an OpenGL window.
  1651  *
  1652  * \note The context must have been created with a compatible window.
  1653  */
  1654 extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_WindowID windowID,
  1655                                                SDL_GLContext context);
  1656 
  1657 /**
  1658  * \fn int SDL_GL_SetSwapInterval(int interval)
  1659  *
  1660  * \brief Set the swap interval for the current OpenGL context.
  1661  *
  1662  * \param interval 0 for immediate updates, 1 for updates synchronized with the vertical retrace
  1663  *
  1664  * \return 0 on success, or -1 if setting the swap interval is not supported.
  1665  *
  1666  * \sa SDL_GL_GetSwapInterval()
  1667  */
  1668 extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval);
  1669 
  1670 /**
  1671  * \fn int SDL_GL_GetSwapInterval(void)
  1672  *
  1673  * \brief Get the swap interval for the current OpenGL context.
  1674  *
  1675  * \return 0 if there is no vertical retrace synchronization, 1 if the buffer swap is synchronized with the vertical retrace, and -1 if getting the swap interval is not supported.
  1676  *
  1677  * \sa SDL_GL_SetSwapInterval()
  1678  */
  1679 extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void);
  1680 
  1681 /**
  1682  * \fn void SDL_GL_SwapWindow(SDL_WindowID windowID)
  1683  *
  1684  * \brief Swap the OpenGL buffers for the window, if double-buffering is supported.
  1685  */
  1686 extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_WindowID windowID);
  1687 
  1688 /**
  1689  * \fn void SDL_GL_DeleteContext(SDL_GLContext context)
  1690  *
  1691  * \brief Delete an OpenGL context.
  1692  *
  1693  * \sa SDL_GL_CreateContext()
  1694  */
  1695 extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context);
  1696 
  1697 /**
  1698  * \def SDL_RectEmpty()
  1699  *
  1700  * \brief Returns true if the rectangle has no area.
  1701  */
  1702 #define SDL_RectEmpty(X)    (((X)->w <= 0) || ((X)->h <= 0))
  1703 
  1704 /**
  1705  * \def SDL_RectEquals()
  1706  *
  1707  * \brief Returns true if the two rectangles are equal.
  1708  */
  1709 #define SDL_RectEquals(A, B)   (((A)->x == (B)->x) && ((A)->y == (B)->y) && \
  1710                                 ((A)->w == (B)->w) && ((A)->h == (B)->h))
  1711 
  1712 /**
  1713  * \fn SDL_bool SDL_HasIntersection(const SDL_Rect * A, const SDL_Rect * B);
  1714  *
  1715  * \brief Determine whether two rectangles intersect.
  1716  *
  1717  * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
  1718  */
  1719 extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A,
  1720                                                      const SDL_Rect * B);
  1721 
  1722 /**
  1723  * \fn SDL_bool SDL_IntersectRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result)
  1724  *
  1725  * \brief Calculate the intersection of two rectangles.
  1726  *
  1727  * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
  1728  */
  1729 extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A,
  1730                                                    const SDL_Rect * B,
  1731                                                    SDL_Rect * result);
  1732 
  1733 /**
  1734  * \fn void SDL_UnionRect(const SDL_Rect * A, const SDL_Rect * B, SDL_Rect * result)
  1735  *
  1736  * \brief Calculate the union of two rectangles
  1737  */
  1738 extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A,
  1739                                            const SDL_Rect * B,
  1740                                            SDL_Rect * result);
  1741 
  1742 /* Ends C function definitions when using C++ */
  1743 #ifdef __cplusplus
  1744 /* *INDENT-OFF* */
  1745 }
  1746 /* *INDENT-ON* */
  1747 #endif
  1748 #include "close_code.h"
  1749 
  1750 #endif /* _SDL_video_h */
  1751 
  1752 /* vi: set ts=4 sw=4 expandtab: */