include/SDL_render.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 22 Jan 2012 01:29:26 -0500
changeset 6248 7fe4b2b78acc
parent 6247 b6212690f78d
child 6258 fce7ce72677b
permissions -rw-r--r--
You need to create the texture with the SDL_TEXTUREACCESS_TARGET flag.
     1 /*
     2   Simple DirectMedia Layer
     3   Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
     4 
     5   This software is provided 'as-is', without any express or implied
     6   warranty.  In no event will the authors be held liable for any damages
     7   arising from the use of this software.
     8 
     9   Permission is granted to anyone to use this software for any purpose,
    10   including commercial applications, and to alter it and redistribute it
    11   freely, subject to the following restrictions:
    12 
    13   1. The origin of this software must not be misrepresented; you must not
    14      claim that you wrote the original software. If you use this software
    15      in a product, an acknowledgment in the product documentation would be
    16      appreciated but is not required.
    17   2. Altered source versions must be plainly marked as such, and must not be
    18      misrepresented as being the original software.
    19   3. This notice may not be removed or altered from any source distribution.
    20 */
    21 
    22 /**
    23  *  \file SDL_render.h
    24  *  
    25  *  Header file for SDL 2D rendering functions.
    26  *
    27  *  This API supports the following features:
    28  *      * single pixel points
    29  *      * single pixel lines
    30  *      * filled rectangles
    31  *      * texture images
    32  *
    33  *  The primitives may be drawn in opaque, blended, or additive modes.
    34  *
    35  *  The texture images may be drawn in opaque, blended, or additive modes.
    36  *  They can have an additional color tint or alpha modulation applied to
    37  *  them, and may also be stretched with linear interpolation.
    38  *
    39  *  This API is designed to accelerate simple 2D operations. You may
    40  *  want more functionality such as rotation and particle effects and
    41  *  in that case you should use SDL's OpenGL/Direct3D support or one
    42  *  of the many good 3D engines.
    43  */
    44 
    45 #ifndef _SDL_render_h
    46 #define _SDL_render_h
    47 
    48 #include "SDL_stdinc.h"
    49 #include "SDL_rect.h"
    50 #include "SDL_video.h"
    51 
    52 #include "begin_code.h"
    53 /* Set up for C function definitions, even when using C++ */
    54 #ifdef __cplusplus
    55 /* *INDENT-OFF* */
    56 extern "C" {
    57 /* *INDENT-ON* */
    58 #endif
    59 
    60 /**
    61  *  \brief Flags used when creating a rendering context
    62  */
    63 typedef enum
    64 {
    65     SDL_RENDERER_SOFTWARE = 0x00000001,         /**< The renderer is a software fallback */ 
    66     SDL_RENDERER_ACCELERATED = 0x00000002,      /**< The renderer uses hardware 
    67                                                      acceleration */
    68     SDL_RENDERER_PRESENTVSYNC = 0x00000004,     /**< Present is synchronized 
    69                                                      with the refresh rate */
    70     SDL_RENDERER_TARGETTEXTURE = 0x00000008     /**< The renderer supports
    71                                                      rendering to texture */
    72 } SDL_RendererFlags;
    73 
    74 /**
    75  *  \brief Information on the capabilities of a render driver or context.
    76  */
    77 typedef struct SDL_RendererInfo
    78 {
    79     const char *name;           /**< The name of the renderer */
    80     Uint32 flags;               /**< Supported ::SDL_RendererFlags */
    81     Uint32 num_texture_formats; /**< The number of available texture formats */
    82     Uint32 texture_formats[16]; /**< The available texture formats */
    83     int max_texture_width;      /**< The maximimum texture width */
    84     int max_texture_height;     /**< The maximimum texture height */
    85 } SDL_RendererInfo;
    86 
    87 /**
    88  *  \brief The access pattern allowed for a texture.
    89  */
    90 typedef enum
    91 {
    92     SDL_TEXTUREACCESS_STATIC,    /**< Changes rarely, not lockable */
    93     SDL_TEXTUREACCESS_STREAMING, /**< Changes frequently, lockable */
    94     SDL_TEXTUREACCESS_TARGET     /**< Texture can be used as a render target */
    95 } SDL_TextureAccess;
    96 
    97 /**
    98  *  \brief The texture channel modulation used in SDL_RenderCopy().
    99  */
   100 typedef enum
   101 {
   102     SDL_TEXTUREMODULATE_NONE = 0x00000000,     /**< No modulation */
   103     SDL_TEXTUREMODULATE_COLOR = 0x00000001,    /**< srcC = srcC * color */
   104     SDL_TEXTUREMODULATE_ALPHA = 0x00000002     /**< srcA = srcA * alpha */
   105 } SDL_TextureModulate;
   106 
   107 /**
   108  *  \brief A structure representing rendering state
   109  */
   110 struct SDL_Renderer;
   111 typedef struct SDL_Renderer SDL_Renderer;
   112 
   113 /**
   114  *  \brief An efficient driver-specific representation of pixel data
   115  */
   116 struct SDL_Texture;
   117 typedef struct SDL_Texture SDL_Texture;
   118 
   119 
   120 /* Function prototypes */
   121 
   122 /**
   123  *  \brief Get the number of 2D rendering drivers available for the current 
   124  *         display.
   125  *  
   126  *  A render driver is a set of code that handles rendering and texture
   127  *  management on a particular display.  Normally there is only one, but
   128  *  some drivers may have several available with different capabilities.
   129  *  
   130  *  \sa SDL_GetRenderDriverInfo()
   131  *  \sa SDL_CreateRenderer()
   132  */
   133 extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
   134 
   135 /**
   136  *  \brief Get information about a specific 2D rendering driver for the current 
   137  *         display.
   138  *  
   139  *  \param index The index of the driver to query information about.
   140  *  \param info  A pointer to an SDL_RendererInfo struct to be filled with 
   141  *               information on the rendering driver.
   142  *  
   143  *  \return 0 on success, -1 if the index was out of range.
   144  *  
   145  *  \sa SDL_CreateRenderer()
   146  */
   147 extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index,
   148                                                     SDL_RendererInfo * info);
   149 
   150 /**
   151  *  \brief Create a 2D rendering context for a window.
   152  *  
   153  *  \param window The window where rendering is displayed.
   154  *  \param index    The index of the rendering driver to initialize, or -1 to 
   155  *                  initialize the first one supporting the requested flags.
   156  *  \param flags    ::SDL_RendererFlags.
   157  *  
   158  *  \return A valid rendering context or NULL if there was an error.
   159  *  
   160  *  \sa SDL_CreateSoftwareRenderer()
   161  *  \sa SDL_GetRendererInfo()
   162  *  \sa SDL_DestroyRenderer()
   163  */
   164 extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window,
   165                                                int index, Uint32 flags);
   166 
   167 /**
   168  *  \brief Create a 2D software rendering context for a surface.
   169  *  
   170  *  \param surface The surface where rendering is done.
   171  *  
   172  *  \return A valid rendering context or NULL if there was an error.
   173  *  
   174  *  \sa SDL_CreateRenderer()
   175  *  \sa SDL_DestroyRenderer()
   176  */
   177 extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface);
   178 
   179 /**
   180  *  \brief Get the renderer associated with a window.
   181  */
   182 extern DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window * window);
   183 
   184 /**
   185  *  \brief Get information about a rendering context.
   186  */
   187 extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer,
   188                                                 SDL_RendererInfo * info);
   189 
   190 /**
   191  *  \brief Create a texture for a rendering context.
   192  *  
   193  *  \param format The format of the texture.
   194  *  \param access One of the enumerated values in ::SDL_TextureAccess.
   195  *  \param w      The width of the texture in pixels.
   196  *  \param h      The height of the texture in pixels.
   197  *  
   198  *  \return The created texture is returned, or 0 if no rendering context was 
   199  *          active,  the format was unsupported, or the width or height were out
   200  *          of range.
   201  *  
   202  *  \sa SDL_QueryTexture()
   203  *  \sa SDL_UpdateTexture()
   204  *  \sa SDL_DestroyTexture()
   205  */
   206 extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer,
   207                                                         Uint32 format,
   208                                                         int access, int w,
   209                                                         int h);
   210 
   211 /**
   212  *  \brief Create a texture from an existing surface.
   213  *  
   214  *  \param surface The surface containing pixel data used to fill the texture.
   215  *  
   216  *  \return The created texture is returned, or 0 on error.
   217  *  
   218  *  \note The surface is not modified or freed by this function.
   219  *  
   220  *  \sa SDL_QueryTexture()
   221  *  \sa SDL_DestroyTexture()
   222  */
   223 extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface);
   224 
   225 /**
   226  *  \brief Query the attributes of a texture
   227  *  
   228  *  \param texture A texture to be queried.
   229  *  \param format  A pointer filled in with the raw format of the texture.  The 
   230  *                 actual format may differ, but pixel transfers will use this 
   231  *                 format.
   232  *  \param access  A pointer filled in with the actual access to the texture.
   233  *  \param w       A pointer filled in with the width of the texture in pixels.
   234  *  \param h       A pointer filled in with the height of the texture in pixels.
   235  *  
   236  *  \return 0 on success, or -1 if the texture is not valid.
   237  */
   238 extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture,
   239                                              Uint32 * format, int *access,
   240                                              int *w, int *h);
   241 
   242 /**
   243  *  \brief Set an additional color value used in render copy operations.
   244  *  
   245  *  \param texture The texture to update.
   246  *  \param r       The red color value multiplied into copy operations.
   247  *  \param g       The green color value multiplied into copy operations.
   248  *  \param b       The blue color value multiplied into copy operations.
   249  *  
   250  *  \return 0 on success, or -1 if the texture is not valid or color modulation 
   251  *          is not supported.
   252  *  
   253  *  \sa SDL_GetTextureColorMod()
   254  */
   255 extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture,
   256                                                    Uint8 r, Uint8 g, Uint8 b);
   257 
   258 
   259 /**
   260  *  \brief Get the additional color value used in render copy operations.
   261  *  
   262  *  \param texture The texture to query.
   263  *  \param r         A pointer filled in with the current red color value.
   264  *  \param g         A pointer filled in with the current green color value.
   265  *  \param b         A pointer filled in with the current blue color value.
   266  *  
   267  *  \return 0 on success, or -1 if the texture is not valid.
   268  *  
   269  *  \sa SDL_SetTextureColorMod()
   270  */
   271 extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture,
   272                                                    Uint8 * r, Uint8 * g,
   273                                                    Uint8 * b);
   274 
   275 /**
   276  *  \brief Set an additional alpha value used in render copy operations.
   277  *  
   278  *  \param texture The texture to update.
   279  *  \param alpha     The alpha value multiplied into copy operations.
   280  *  
   281  *  \return 0 on success, or -1 if the texture is not valid or alpha modulation 
   282  *          is not supported.
   283  *  
   284  *  \sa SDL_GetTextureAlphaMod()
   285  */
   286 extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture,
   287                                                    Uint8 alpha);
   288 
   289 /**
   290  *  \brief Get the additional alpha value used in render copy operations.
   291  *  
   292  *  \param texture The texture to query.
   293  *  \param alpha     A pointer filled in with the current alpha value.
   294  *  
   295  *  \return 0 on success, or -1 if the texture is not valid.
   296  *  
   297  *  \sa SDL_SetTextureAlphaMod()
   298  */
   299 extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture,
   300                                                    Uint8 * alpha);
   301 
   302 /**
   303  *  \brief Set the blend mode used for texture copy operations.
   304  *  
   305  *  \param texture The texture to update.
   306  *  \param blendMode ::SDL_BlendMode to use for texture blending.
   307  *  
   308  *  \return 0 on success, or -1 if the texture is not valid or the blend mode is
   309  *          not supported.
   310  *  
   311  *  \note If the blend mode is not supported, the closest supported mode is
   312  *        chosen.
   313  *  
   314  *  \sa SDL_GetTextureBlendMode()
   315  */
   316 extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture,
   317                                                     SDL_BlendMode blendMode);
   318 
   319 /**
   320  *  \brief Get the blend mode used for texture copy operations.
   321  *  
   322  *  \param texture   The texture to query.
   323  *  \param blendMode A pointer filled in with the current blend mode.
   324  *  
   325  *  \return 0 on success, or -1 if the texture is not valid.
   326  *  
   327  *  \sa SDL_SetTextureBlendMode()
   328  */
   329 extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture,
   330                                                     SDL_BlendMode *blendMode);
   331 
   332 /**
   333  *  \brief Update the given texture rectangle with new pixel data.
   334  *  
   335  *  \param texture   The texture to update
   336  *  \param rect      A pointer to the rectangle of pixels to update, or NULL to 
   337  *                   update the entire texture.
   338  *  \param pixels    The raw pixel data.
   339  *  \param pitch     The number of bytes between rows of pixel data.
   340  *  
   341  *  \return 0 on success, or -1 if the texture is not valid.
   342  *  
   343  *  \note This is a fairly slow function.
   344  */
   345 extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture,
   346                                               const SDL_Rect * rect,
   347                                               const void *pixels, int pitch);
   348 
   349 /**
   350  *  \brief Lock a portion of the texture for pixel access.
   351  *  
   352  *  \param texture   The texture to lock for access, which was created with 
   353  *                   ::SDL_TEXTUREACCESS_STREAMING.
   354  *  \param rect      A pointer to the rectangle to lock for access. If the rect 
   355  *                   is NULL, the entire texture will be locked.
   356  *  \param pixels    This is filled in with a pointer to the locked pixels, 
   357  *                   appropriately offset by the locked area.
   358  *  \param pitch     This is filled in with the pitch of the locked pixels.
   359  *  
   360  *  \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING.
   361  *  
   362  *  \sa SDL_UnlockTexture()
   363  */
   364 extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture,
   365                                             const SDL_Rect * rect,
   366                                             void **pixels, int *pitch);
   367 
   368 /**
   369  *  \brief Unlock a texture, uploading the changes to video memory, if needed.
   370  *  
   371  *  \sa SDL_LockTexture()
   372  */
   373 extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture);
   374 
   375 /**
   376  * \brief Determines whether a window supports the use of render targets
   377  *
   378  * \param renderer The renderer that will be checked
   379  *
   380  * \return SDL_TRUE if supported, SDL_FALSE if not.
   381  */
   382 extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer);
   383 
   384 /**
   385  * \brief Set a texture as the current rendering target.
   386  *
   387  * \param texture The targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target
   388  *
   389  * \return 0 on success, or -1 on error
   390  */
   391 extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer,
   392                                                 SDL_Texture *texture);
   393 
   394 /**
   395  *  \brief Set the drawing area for rendering on the current target.
   396  *
   397  *  \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target.
   398  *
   399  *  The x,y of the viewport rect represents the origin for rendering.
   400  *
   401  *  \note When the window is resized, the current viewport is automatically
   402  *        centered within the new window size.
   403  */
   404 extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer,
   405                                                   const SDL_Rect * rect);
   406 
   407 /**
   408  *  \brief Get the drawing area for the current target.
   409  */
   410 extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer,
   411                                                    SDL_Rect * rect);
   412 
   413 /**
   414  *  \brief Set the color used for drawing operations (Rect, Line and Clear).
   415  *  
   416  *  \param r The red value used to draw on the rendering target.
   417  *  \param g The green value used to draw on the rendering target.
   418  *  \param b The blue value used to draw on the rendering target.
   419  *  \param a The alpha value used to draw on the rendering target, usually 
   420  *           ::SDL_ALPHA_OPAQUE (255).
   421  *  
   422  *  \return 0 on success, or -1 on error
   423  */
   424 extern DECLSPEC int SDL_SetRenderDrawColor(SDL_Renderer * renderer,
   425                                            Uint8 r, Uint8 g, Uint8 b,
   426                                            Uint8 a);
   427 
   428 /**
   429  *  \brief Get the color used for drawing operations (Rect, Line and Clear).
   430  *  
   431  *  \param r A pointer to the red value used to draw on the rendering target.
   432  *  \param g A pointer to the green value used to draw on the rendering target.
   433  *  \param b A pointer to the blue value used to draw on the rendering target.
   434  *  \param a A pointer to the alpha value used to draw on the rendering target, 
   435  *           usually ::SDL_ALPHA_OPAQUE (255).
   436  *  
   437  *  \return 0 on success, or -1 on error
   438  */
   439 extern DECLSPEC int SDL_GetRenderDrawColor(SDL_Renderer * renderer,
   440                                            Uint8 * r, Uint8 * g, Uint8 * b,
   441                                            Uint8 * a);
   442 
   443 /**
   444  *  \brief Set the blend mode used for drawing operations (Fill and Line).
   445  *  
   446  *  \param blendMode ::SDL_BlendMode to use for blending.
   447  *  
   448  *  \return 0 on success, or -1 on error
   449  *  
   450  *  \note If the blend mode is not supported, the closest supported mode is 
   451  *        chosen.
   452  *  
   453  *  \sa SDL_GetRenderDrawBlendMode()
   454  */
   455 extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer,
   456                                                        SDL_BlendMode blendMode);
   457 
   458 /**
   459  *  \brief Get the blend mode used for drawing operations.
   460  *  
   461  *  \param blendMode A pointer filled in with the current blend mode.
   462  *  
   463  *  \return 0 on success, or -1 on error
   464  *  
   465  *  \sa SDL_SetRenderDrawBlendMode()
   466  */
   467 extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer,
   468                                                        SDL_BlendMode *blendMode);
   469 
   470 /**
   471  *  \brief Clear the current rendering target with the drawing color
   472  *
   473  *  This function clears the entire rendering target, ignoring the viewport.
   474  */
   475 extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer * renderer);
   476 
   477 /**
   478  *  \brief Draw a point on the current rendering target.
   479  *  
   480  *  \param x The x coordinate of the point.
   481  *  \param y The y coordinate of the point.
   482  *  
   483  *  \return 0 on success, or -1 on error
   484  */
   485 extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer * renderer,
   486                                                 int x, int y);
   487 
   488 /**
   489  *  \brief Draw multiple points on the current rendering target.
   490  *  
   491  *  \param points The points to draw
   492  *  \param count The number of points to draw
   493  *  
   494  *  \return 0 on success, or -1 on error
   495  */
   496 extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(SDL_Renderer * renderer,
   497                                                  const SDL_Point * points,
   498                                                  int count);
   499 
   500 /**
   501  *  \brief Draw a line on the current rendering target.
   502  *  
   503  *  \param x1 The x coordinate of the start point.
   504  *  \param y1 The y coordinate of the start point.
   505  *  \param x2 The x coordinate of the end point.
   506  *  \param y2 The y coordinate of the end point.
   507  *  
   508  *  \return 0 on success, or -1 on error
   509  */
   510 extern DECLSPEC int SDLCALL SDL_RenderDrawLine(SDL_Renderer * renderer,
   511                                                int x1, int y1, int x2, int y2);
   512 
   513 /**
   514  *  \brief Draw a series of connected lines on the current rendering target.
   515  *  
   516  *  \param points The points along the lines
   517  *  \param count The number of points, drawing count-1 lines
   518  *  
   519  *  \return 0 on success, or -1 on error
   520  */
   521 extern DECLSPEC int SDLCALL SDL_RenderDrawLines(SDL_Renderer * renderer,
   522                                                 const SDL_Point * points,
   523                                                 int count);
   524 
   525 /**
   526  *  \brief Draw a rectangle on the current rendering target.
   527  *  
   528  *  \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
   529  *  
   530  *  \return 0 on success, or -1 on error
   531  */
   532 extern DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer * renderer,
   533                                                const SDL_Rect * rect);
   534 
   535 /**
   536  *  \brief Draw some number of rectangles on the current rendering target.
   537  *  
   538  *  \param rects A pointer to an array of destination rectangles.
   539  *  \param count The number of rectangles.
   540  *  
   541  *  \return 0 on success, or -1 on error
   542  */
   543 extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer,
   544                                                 const SDL_Rect * rects,
   545                                                 int count);
   546 
   547 /**
   548  *  \brief Fill a rectangle on the current rendering target with the drawing color.
   549  *  
   550  *  \param rect A pointer to the destination rectangle, or NULL for the entire 
   551  *              rendering target.
   552  *  
   553  *  \return 0 on success, or -1 on error
   554  */
   555 extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer * renderer,
   556                                                const SDL_Rect * rect);
   557 
   558 /**
   559  *  \brief Fill some number of rectangles on the current rendering target with the drawing color.
   560  *  
   561  *  \param rects A pointer to an array of destination rectangles.
   562  *  \param count The number of rectangles.
   563  *  
   564  *  \return 0 on success, or -1 on error
   565  */
   566 extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer,
   567                                                 const SDL_Rect * rects,
   568                                                 int count);
   569 
   570 /**
   571  *  \brief Copy a portion of the texture to the current rendering target.
   572  *  
   573  *  \param texture The source texture.
   574  *  \param srcrect   A pointer to the source rectangle, or NULL for the entire 
   575  *                   texture.
   576  *  \param dstrect   A pointer to the destination rectangle, or NULL for the 
   577  *                   entire rendering target.
   578  *  
   579  *  \return 0 on success, or -1 on error
   580  */
   581 extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer,
   582                                            SDL_Texture * texture,
   583                                            const SDL_Rect * srcrect,
   584                                            const SDL_Rect * dstrect);
   585 
   586 
   587 /**
   588  *  \brief Read pixels from the current rendering target.
   589  *  
   590  *  \param rect   A pointer to the rectangle to read, or NULL for the entire 
   591  *                render target.
   592  *  \param format The desired format of the pixel data, or 0 to use the format
   593  *                of the rendering target
   594  *  \param pixels A pointer to be filled in with the pixel data
   595  *  \param pitch  The pitch of the pixels parameter.
   596  *  
   597  *  \return 0 on success, or -1 if pixel reading is not supported.
   598  *  
   599  *  \warning This is a very slow operation, and should not be used frequently.
   600  */
   601 extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer * renderer,
   602                                                  const SDL_Rect * rect,
   603                                                  Uint32 format,
   604                                                  void *pixels, int pitch);
   605 
   606 /**
   607  *  \brief Update the screen with rendering performed.
   608  */
   609 extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer * renderer);
   610 
   611 /**
   612  *  \brief Destroy the specified texture.
   613  *  
   614  *  \sa SDL_CreateTexture()
   615  *  \sa SDL_CreateTextureFromSurface()
   616  */
   617 extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture);
   618 
   619 /**
   620  *  \brief Destroy the rendering context for a window and free associated
   621  *         textures.
   622  *  
   623  *  \sa SDL_CreateRenderer()
   624  */
   625 extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer);
   626 
   627 
   628 /* Ends C function definitions when using C++ */
   629 #ifdef __cplusplus
   630 /* *INDENT-OFF* */
   631 }
   632 /* *INDENT-ON* */
   633 #endif
   634 #include "close_code.h"
   635 
   636 #endif /* _SDL_render_h */
   637 
   638 /* vi: set ts=4 sw=4 expandtab: */