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