include/SDL_render.h
changeset 5145 2f44e6969a59
child 5147 ad50b3db78bd
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/include/SDL_render.h	Tue Feb 01 15:02:21 2011 -0800
     1.3 @@ -0,0 +1,639 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997-2010 Sam Lantinga
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Lesser General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2.1 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Lesser General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Lesser General Public
    1.19 +    License along with this library; if not, write to the Free Software
    1.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1.21 +
    1.22 +    Sam Lantinga
    1.23 +    slouken@libsdl.org
    1.24 +*/
    1.25 +
    1.26 +/**
    1.27 + *  \file SDL_render.h
    1.28 + *  
    1.29 + *  Header file for SDL 2D rendering functions.
    1.30 + */
    1.31 +
    1.32 +#ifndef _SDL_render_h
    1.33 +#define _SDL_render_h
    1.34 +
    1.35 +#include "SDL_stdinc.h"
    1.36 +//#include "SDL_pixels.h"
    1.37 +#include "SDL_rect.h"
    1.38 +#include "SDL_video.h"
    1.39 +
    1.40 +#include "begin_code.h"
    1.41 +/* Set up for C function definitions, even when using C++ */
    1.42 +#ifdef __cplusplus
    1.43 +/* *INDENT-OFF* */
    1.44 +extern "C" {
    1.45 +/* *INDENT-ON* */
    1.46 +#endif
    1.47 +
    1.48 +/**
    1.49 + *  \brief Flags used when creating a rendering context
    1.50 + */
    1.51 +typedef enum
    1.52 +{
    1.53 +    SDL_RENDERER_ACCELERATED = 0x00000001,      /**< The renderer uses hardware 
    1.54 +                                                     acceleration */
    1.55 +    SDL_RENDERER_PRESENTVSYNC = 0x00000002      /**< Present is synchronized 
    1.56 +                                                     with the refresh rate */
    1.57 +} SDL_RendererFlags;
    1.58 +
    1.59 +/**
    1.60 + *  \brief Information on the capabilities of a render driver or context.
    1.61 + */
    1.62 +typedef struct SDL_RendererInfo
    1.63 +{
    1.64 +    const char *name;           /**< The name of the renderer */
    1.65 +    Uint32 flags;               /**< Supported ::SDL_RendererFlags */
    1.66 +    Uint32 num_texture_formats; /**< The number of available texture formats */
    1.67 +    Uint32 texture_formats[50]; /**< The available texture formats */
    1.68 +    int max_texture_width;      /**< The maximimum texture width */
    1.69 +    int max_texture_height;     /**< The maximimum texture height */
    1.70 +} SDL_RendererInfo;
    1.71 +
    1.72 +/**
    1.73 + *  \brief The access pattern allowed for a texture.
    1.74 + */
    1.75 +typedef enum
    1.76 +{
    1.77 +    SDL_TEXTUREACCESS_STATIC,    /**< Changes rarely, not lockable */
    1.78 +    SDL_TEXTUREACCESS_STREAMING  /**< Changes frequently, lockable */
    1.79 +} SDL_TextureAccess;
    1.80 +
    1.81 +/**
    1.82 + *  \brief The texture channel modulation used in SDL_RenderCopy().
    1.83 + */
    1.84 +typedef enum
    1.85 +{
    1.86 +    SDL_TEXTUREMODULATE_NONE = 0x00000000,     /**< No modulation */
    1.87 +    SDL_TEXTUREMODULATE_COLOR = 0x00000001,    /**< srcC = srcC * color */
    1.88 +    SDL_TEXTUREMODULATE_ALPHA = 0x00000002     /**< srcA = srcA * alpha */
    1.89 +} SDL_TextureModulate;
    1.90 +
    1.91 +/**
    1.92 + *  \brief An efficient driver-specific representation of pixel data
    1.93 + */
    1.94 +struct SDL_Texture;
    1.95 +typedef struct SDL_Texture SDL_Texture;
    1.96 +
    1.97 +
    1.98 +/* Function prototypes */
    1.99 +
   1.100 +/**
   1.101 + *  \brief Get the number of 2D rendering drivers available for the current 
   1.102 + *         display.
   1.103 + *  
   1.104 + *  A render driver is a set of code that handles rendering and texture
   1.105 + *  management on a particular display.  Normally there is only one, but
   1.106 + *  some drivers may have several available with different capabilities.
   1.107 + *  
   1.108 + *  \sa SDL_GetRenderDriverInfo()
   1.109 + *  \sa SDL_CreateRenderer()
   1.110 + */
   1.111 +extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
   1.112 +
   1.113 +/**
   1.114 + *  \brief Get information about a specific 2D rendering driver for the current 
   1.115 + *         display.
   1.116 + *  
   1.117 + *  \param index The index of the driver to query information about.
   1.118 + *  \param info  A pointer to an SDL_RendererInfo struct to be filled with 
   1.119 + *               information on the rendering driver.
   1.120 + *  
   1.121 + *  \return 0 on success, -1 if the index was out of range.
   1.122 + *  
   1.123 + *  \sa SDL_CreateRenderer()
   1.124 + */
   1.125 +extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index,
   1.126 +                                                    SDL_RendererInfo * info);
   1.127 +
   1.128 +/**
   1.129 + *  \brief Create and make active a 2D rendering context for a window.
   1.130 + *  
   1.131 + *  \param window The window where rendering is displayed.
   1.132 + *  \param index    The index of the rendering driver to initialize, or -1 to 
   1.133 + *                  initialize the first one supporting the requested flags.
   1.134 + *  \param flags    ::SDL_RendererFlags.
   1.135 + *  
   1.136 + *  \return 0 on success, -1 if there was an error creating the renderer.
   1.137 + *  
   1.138 + *  \sa SDL_SelectRenderer()
   1.139 + *  \sa SDL_GetRendererInfo()
   1.140 + *  \sa SDL_DestroyRenderer()
   1.141 + */
   1.142 +extern DECLSPEC int SDLCALL SDL_CreateRenderer(SDL_Window * window,
   1.143 +                                               int index, Uint32 flags);
   1.144 +
   1.145 +/**
   1.146 + *  \brief Select the rendering context for a particular window.
   1.147 + *  
   1.148 + *  \return 0 on success, -1 if the selected window doesn't have a
   1.149 + *          rendering context.
   1.150 + */
   1.151 +extern DECLSPEC int SDLCALL SDL_SelectRenderer(SDL_Window * window);
   1.152 +
   1.153 +/**
   1.154 + *  \brief Get information about the current rendering context.
   1.155 + */
   1.156 +extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_RendererInfo * info);
   1.157 +
   1.158 +/**
   1.159 + *  \brief Create a texture for the current rendering context.
   1.160 + *  
   1.161 + *  \param format The format of the texture.
   1.162 + *  \param access One of the enumerated values in ::SDL_TextureAccess.
   1.163 + *  \param w      The width of the texture in pixels.
   1.164 + *  \param h      The height of the texture in pixels.
   1.165 + *  
   1.166 + *  \return The created texture is returned, or 0 if no rendering context was 
   1.167 + *          active,  the format was unsupported, or the width or height were out
   1.168 + *          of range.
   1.169 + *  
   1.170 + *  \sa SDL_QueryTexture()
   1.171 + *  \sa SDL_DestroyTexture()
   1.172 + */
   1.173 +extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(Uint32 format,
   1.174 +                                                        int access, int w,
   1.175 +                                                        int h);
   1.176 +
   1.177 +/**
   1.178 + *  \brief Create a texture from an existing surface.
   1.179 + *  
   1.180 + *  \param format The format of the texture, or 0 to pick an appropriate format.
   1.181 + *  \param surface The surface containing pixel data used to fill the texture.
   1.182 + *  
   1.183 + *  \return The created texture is returned, or 0 if no rendering context was 
   1.184 + *          active,  the format was unsupported, or the surface width or height 
   1.185 + *          were out of range.
   1.186 + *  
   1.187 + *  \note The surface is not modified or freed by this function.
   1.188 + *  
   1.189 + *  \sa SDL_QueryTexture()
   1.190 + *  \sa SDL_DestroyTexture()
   1.191 + */
   1.192 +extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(Uint32
   1.193 +                                                                   format,
   1.194 +                                                                   SDL_Surface
   1.195 +                                                                   * surface);
   1.196 +
   1.197 +/**
   1.198 + *  \brief Query the attributes of a texture
   1.199 + *  
   1.200 + *  \param texture A texture to be queried.
   1.201 + *  \param format  A pointer filled in with the raw format of the texture.  The 
   1.202 + *                 actual format may differ, but pixel transfers will use this 
   1.203 + *                 format.
   1.204 + *  \param access  A pointer filled in with the actual access to the texture.
   1.205 + *  \param w       A pointer filled in with the width of the texture in pixels.
   1.206 + *  \param h       A pointer filled in with the height of the texture in pixels.
   1.207 + *  
   1.208 + *  \return 0 on success, or -1 if the texture is not valid.
   1.209 + */
   1.210 +extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture,
   1.211 +                                             Uint32 * format, int *access,
   1.212 +                                             int *w, int *h);
   1.213 +
   1.214 +/**
   1.215 + *  \brief Query the pixels of a texture, if the texture does not need to be 
   1.216 + *         locked for pixel access.
   1.217 + *  
   1.218 + *  \param texture A texture to be queried, which was created with 
   1.219 + *                   ::SDL_TEXTUREACCESS_STREAMING.
   1.220 + *  \param pixels    A pointer filled with a pointer to the pixels for the 
   1.221 + *                   texture.
   1.222 + *  \param pitch     A pointer filled in with the pitch of the pixel data.
   1.223 + *  
   1.224 + *  \return 0 on success, or -1 if the texture is not valid, or must be locked 
   1.225 + *          for pixel access.
   1.226 + */
   1.227 +extern DECLSPEC int SDLCALL SDL_QueryTexturePixels(SDL_Texture * texture,
   1.228 +                                                   void **pixels, int *pitch);
   1.229 +
   1.230 +/**
   1.231 + *  \brief Set the color palette of an indexed texture.
   1.232 + *  
   1.233 + *  \param texture  The texture to update.
   1.234 + *  \param colors     The array of RGB color data.
   1.235 + *  \param firstcolor The first index to update.
   1.236 + *  \param ncolors    The number of palette entries to fill with the color data.
   1.237 + *  
   1.238 + *  \return 0 on success, or -1 if the texture is not valid or not an indexed 
   1.239 + *          texture.
   1.240 + */
   1.241 +extern DECLSPEC int SDLCALL SDL_SetTexturePalette(SDL_Texture * texture,
   1.242 +                                                  const SDL_Color * colors,
   1.243 +                                                  int firstcolor,
   1.244 +                                                  int ncolors);
   1.245 +
   1.246 +/**
   1.247 + *  \brief Get the color palette from an indexed texture if it has one.
   1.248 + *  
   1.249 + *  \param texture  The texture to update.
   1.250 + *  \param colors     The array to fill with RGB color data.
   1.251 + *  \param firstcolor The first index to retrieve.
   1.252 + *  \param ncolors    The number of palette entries to retrieve.
   1.253 + *  
   1.254 + *  \return 0 on success, or -1 if the texture is not valid or not an indexed 
   1.255 + *          texture.
   1.256 + */
   1.257 +extern DECLSPEC int SDLCALL SDL_GetTexturePalette(SDL_Texture * texture,
   1.258 +                                                  SDL_Color * colors,
   1.259 +                                                  int firstcolor,
   1.260 +                                                  int ncolors);
   1.261 +
   1.262 +/**
   1.263 + *  \brief Set an additional color value used in render copy operations.
   1.264 + *  
   1.265 + *  \param texture The texture to update.
   1.266 + *  \param r       The red color value multiplied into copy operations.
   1.267 + *  \param g       The green color value multiplied into copy operations.
   1.268 + *  \param b       The blue color value multiplied into copy operations.
   1.269 + *  
   1.270 + *  \return 0 on success, or -1 if the texture is not valid or color modulation 
   1.271 + *          is not supported.
   1.272 + *  
   1.273 + *  \sa SDL_GetTextureColorMod()
   1.274 + */
   1.275 +extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture,
   1.276 +                                                   Uint8 r, Uint8 g, Uint8 b);
   1.277 +
   1.278 +
   1.279 +/**
   1.280 + *  \brief Get the additional color value used in render copy operations.
   1.281 + *  
   1.282 + *  \param texture The texture to query.
   1.283 + *  \param r         A pointer filled in with the current red color value.
   1.284 + *  \param g         A pointer filled in with the current green color value.
   1.285 + *  \param b         A pointer filled in with the current blue color value.
   1.286 + *  
   1.287 + *  \return 0 on success, or -1 if the texture is not valid.
   1.288 + *  
   1.289 + *  \sa SDL_SetTextureColorMod()
   1.290 + */
   1.291 +extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture,
   1.292 +                                                   Uint8 * r, Uint8 * g,
   1.293 +                                                   Uint8 * b);
   1.294 +
   1.295 +/**
   1.296 + *  \brief Set an additional alpha value used in render copy operations.
   1.297 + *  
   1.298 + *  \param texture The texture to update.
   1.299 + *  \param alpha     The alpha value multiplied into copy operations.
   1.300 + *  
   1.301 + *  \return 0 on success, or -1 if the texture is not valid or alpha modulation 
   1.302 + *          is not supported.
   1.303 + *  
   1.304 + *  \sa SDL_GetTextureAlphaMod()
   1.305 + */
   1.306 +extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture,
   1.307 +                                                   Uint8 alpha);
   1.308 +
   1.309 +/**
   1.310 + *  \brief Get the additional alpha value used in render copy operations.
   1.311 + *  
   1.312 + *  \param texture The texture to query.
   1.313 + *  \param alpha     A pointer filled in with the current alpha value.
   1.314 + *  
   1.315 + *  \return 0 on success, or -1 if the texture is not valid.
   1.316 + *  
   1.317 + *  \sa SDL_SetTextureAlphaMod()
   1.318 + */
   1.319 +extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture,
   1.320 +                                                   Uint8 * alpha);
   1.321 +
   1.322 +/**
   1.323 + *  \brief Set the blend mode used for texture copy operations.
   1.324 + *  
   1.325 + *  \param texture The texture to update.
   1.326 + *  \param blendMode ::SDL_BlendMode to use for texture blending.
   1.327 + *  
   1.328 + *  \return 0 on success, or -1 if the texture is not valid or the blend mode is
   1.329 + *          not supported.
   1.330 + *  
   1.331 + *  \note If the blend mode is not supported, the closest supported mode is
   1.332 + *        chosen.
   1.333 + *  
   1.334 + *  \sa SDL_GetTextureBlendMode()
   1.335 + */
   1.336 +extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture,
   1.337 +                                                    SDL_BlendMode blendMode);
   1.338 +
   1.339 +/**
   1.340 + *  \brief Get the blend mode used for texture copy operations.
   1.341 + *  
   1.342 + *  \param texture The texture to query.
   1.343 + *  \param blendMode A pointer filled in with the current blend mode.
   1.344 + *  
   1.345 + *  \return 0 on success, or -1 if the texture is not valid.
   1.346 + *  
   1.347 + *  \sa SDL_SetTextureBlendMode()
   1.348 + */
   1.349 +extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture,
   1.350 +                                                    SDL_BlendMode *blendMode);
   1.351 +
   1.352 +/**
   1.353 + *  \brief Update the given texture rectangle with new pixel data.
   1.354 + *  
   1.355 + *  \param texture The texture to update
   1.356 + *  \param rect      A pointer to the rectangle of pixels to update, or NULL to 
   1.357 + *                   update the entire texture.
   1.358 + *  \param pixels    The raw pixel data.
   1.359 + *  \param pitch     The number of bytes between rows of pixel data.
   1.360 + *  
   1.361 + *  \return 0 on success, or -1 if the texture is not valid.
   1.362 + *  
   1.363 + *  \note This is a fairly slow function.
   1.364 + */
   1.365 +extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture,
   1.366 +                                              const SDL_Rect * rect,
   1.367 +                                              const void *pixels, int pitch);
   1.368 +
   1.369 +/**
   1.370 + *  \brief Lock a portion of the texture for pixel access.
   1.371 + *  
   1.372 + *  \param texture The texture to lock for access, which was created with 
   1.373 + *                   ::SDL_TEXTUREACCESS_STREAMING.
   1.374 + *  \param rect      A pointer to the rectangle to lock for access. If the rect 
   1.375 + *                   is NULL, the entire texture will be locked.
   1.376 + *  \param markDirty If this is nonzero, the locked area will be marked dirty 
   1.377 + *                   when the texture is unlocked.
   1.378 + *  \param pixels    This is filled in with a pointer to the locked pixels, 
   1.379 + *                   appropriately offset by the locked area.
   1.380 + *  \param pitch     This is filled in with the pitch of the locked pixels.
   1.381 + *  
   1.382 + *  \return 0 on success, or -1 if the texture is not valid or was created with 
   1.383 + *          ::SDL_TEXTUREACCESS_STATIC.
   1.384 + *  
   1.385 + *  \sa SDL_DirtyTexture()
   1.386 + *  \sa SDL_UnlockTexture()
   1.387 + */
   1.388 +extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture,
   1.389 +                                            const SDL_Rect * rect,
   1.390 +                                            int markDirty, void **pixels,
   1.391 +                                            int *pitch);
   1.392 +
   1.393 +/**
   1.394 + *  \brief Unlock a texture, uploading the changes to renderer memory, if needed.
   1.395 + *  
   1.396 + *  \sa SDL_LockTexture()
   1.397 + *  \sa SDL_DirtyTexture()
   1.398 + */
   1.399 +extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture);
   1.400 +
   1.401 +/**
   1.402 + *  \brief Mark the specified rectangles of the texture as dirty.
   1.403 + *  
   1.404 + *  \param texture The texture to mark dirty, which was created with 
   1.405 + *                   ::SDL_TEXTUREACCESS_STREAMING.
   1.406 + *  \param numrects  The number of rectangles pointed to by rects.
   1.407 + *  \param rects     The pointer to an array of dirty rectangles.
   1.408 + *  
   1.409 + *  \sa SDL_LockTexture()
   1.410 + *  \sa SDL_UnlockTexture()
   1.411 + */
   1.412 +extern DECLSPEC void SDLCALL SDL_DirtyTexture(SDL_Texture * texture,
   1.413 +                                              int numrects,
   1.414 +                                              const SDL_Rect * rects);
   1.415 +
   1.416 +/**
   1.417 + *  \brief Set the color used for drawing operations (Fill and Line).
   1.418 + *  
   1.419 + *  \param r The red value used to draw on the rendering target.
   1.420 + *  \param g The green value used to draw on the rendering target.
   1.421 + *  \param b The blue value used to draw on the rendering target.
   1.422 + *  \param a The alpha value used to draw on the rendering target, usually 
   1.423 + *           ::SDL_ALPHA_OPAQUE (255).
   1.424 + *  
   1.425 + *  \return 0 on success, or -1 if there is no rendering context current.
   1.426 + */
   1.427 +extern DECLSPEC int SDL_SetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b,
   1.428 +                                           Uint8 a);
   1.429 +
   1.430 +/**
   1.431 + *  \brief Get the color used for drawing operations (Fill and Line).
   1.432 + *  
   1.433 + *  \param r A pointer to the red value used to draw on the rendering target.
   1.434 + *  \param g A pointer to the green value used to draw on the rendering target.
   1.435 + *  \param b A pointer to the blue value used to draw on the rendering target.
   1.436 + *  \param a A pointer to the alpha value used to draw on the rendering target, 
   1.437 + *           usually ::SDL_ALPHA_OPAQUE (255).
   1.438 + *  
   1.439 + *  \return 0 on success, or -1 if there is no rendering context current.
   1.440 + */
   1.441 +extern DECLSPEC int SDL_GetRenderDrawColor(Uint8 * r, Uint8 * g, Uint8 * b,
   1.442 +                                           Uint8 * a);
   1.443 +
   1.444 +/**
   1.445 + *  \brief Set the blend mode used for drawing operations (Fill and Line).
   1.446 + *  
   1.447 + *  \param blendMode ::SDL_BlendMode to use for blending.
   1.448 + *  
   1.449 + *  \return 0 on success, or -1 if there is no rendering context current.
   1.450 + *  
   1.451 + *  \note If the blend mode is not supported, the closest supported mode is 
   1.452 + *        chosen.
   1.453 + *  
   1.454 + *  \sa SDL_GetRenderDrawBlendMode()
   1.455 + */
   1.456 +extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_BlendMode blendMode);
   1.457 +
   1.458 +/**
   1.459 + *  \brief Get the blend mode used for drawing operations.
   1.460 + *  
   1.461 + *  \param blendMode A pointer filled in with the current blend mode.
   1.462 + *  
   1.463 + *  \return 0 on success, or -1 if there is no rendering context current.
   1.464 + *  
   1.465 + *  \sa SDL_SetRenderDrawBlendMode()
   1.466 + */
   1.467 +extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_BlendMode *blendMode);
   1.468 +
   1.469 +/**
   1.470 + *  \brief Clear the current rendering target with the drawing color
   1.471 + */
   1.472 +extern DECLSPEC int SDLCALL SDL_RenderClear(void);
   1.473 +
   1.474 +/**
   1.475 + *  \brief Draw a point on the current rendering target.
   1.476 + *  
   1.477 + *  \param x The x coordinate of the point.
   1.478 + *  \param y The y coordinate of the point.
   1.479 + *  
   1.480 + *  \return 0 on success, or -1 if there is no rendering context current.
   1.481 + */
   1.482 +extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(int x, int y);
   1.483 +
   1.484 +/**
   1.485 + *  \brief Draw multiple points on the current rendering target.
   1.486 + *  
   1.487 + *  \param points The points to draw
   1.488 + *  \param count The number of points to draw
   1.489 + *  
   1.490 + *  \return 0 on success, or -1 if there is no rendering context current.
   1.491 + */
   1.492 +extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(const SDL_Point * points,
   1.493 +                                                 int count);
   1.494 +
   1.495 +/**
   1.496 + *  \brief Draw a line on the current rendering target.
   1.497 + *  
   1.498 + *  \param x1 The x coordinate of the start point.
   1.499 + *  \param y1 The y coordinate of the start point.
   1.500 + *  \param x2 The x coordinate of the end point.
   1.501 + *  \param y2 The y coordinate of the end point.
   1.502 + *  
   1.503 + *  \return 0 on success, or -1 if there is no rendering context current.
   1.504 + */
   1.505 +extern DECLSPEC int SDLCALL SDL_RenderDrawLine(int x1, int y1, int x2, int y2);
   1.506 +
   1.507 +/**
   1.508 + *  \brief Draw a series of connected lines on the current rendering target.
   1.509 + *  
   1.510 + *  \param points The points along the lines
   1.511 + *  \param count The number of points, drawing count-1 lines
   1.512 + *  
   1.513 + *  \return 0 on success, or -1 if there is no rendering context current.
   1.514 + */
   1.515 +extern DECLSPEC int SDLCALL SDL_RenderDrawLines(const SDL_Point * points,
   1.516 +                                                int count);
   1.517 +
   1.518 +/**
   1.519 + *  \brief Draw a rectangle on the current rendering target.
   1.520 + *  
   1.521 + *  \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
   1.522 + *  
   1.523 + *  \return 0 on success, or -1 if there is no rendering context current.
   1.524 + */
   1.525 +extern DECLSPEC int SDLCALL SDL_RenderDrawRect(const SDL_Rect * rect);
   1.526 +
   1.527 +/**
   1.528 + *  \brief Draw some number of rectangles on the current rendering target.
   1.529 + *  
   1.530 + *  \param rects A pointer to an array of destination rectangles.
   1.531 + *  \param count The number of rectangles.
   1.532 + *  
   1.533 + *  \return 0 on success, or -1 if there is no rendering context current.
   1.534 + */
   1.535 +extern DECLSPEC int SDLCALL SDL_RenderDrawRects(const SDL_Rect ** rects, int count);
   1.536 +
   1.537 +/**
   1.538 + *  \brief Fill a rectangle on the current rendering target with the drawing color.
   1.539 + *  
   1.540 + *  \param rect A pointer to the destination rectangle, or NULL for the entire 
   1.541 + *              rendering target.
   1.542 + *  
   1.543 + *  \return 0 on success, or -1 if there is no rendering context current.
   1.544 + */
   1.545 +extern DECLSPEC int SDLCALL SDL_RenderFillRect(const SDL_Rect * rect);
   1.546 +
   1.547 +/**
   1.548 + *  \brief Fill some number of rectangles on the current rendering target with the drawing color.
   1.549 + *  
   1.550 + *  \param rects A pointer to an array of destination rectangles.
   1.551 + *  \param count The number of rectangles.
   1.552 + *  
   1.553 + *  \return 0 on success, or -1 if there is no rendering context current.
   1.554 + */
   1.555 +extern DECLSPEC int SDLCALL SDL_RenderFillRects(const SDL_Rect ** rect, int count);
   1.556 +
   1.557 +/**
   1.558 + *  \brief Copy a portion of the texture to the current rendering target.
   1.559 + *  
   1.560 + *  \param texture The source texture.
   1.561 + *  \param srcrect   A pointer to the source rectangle, or NULL for the entire 
   1.562 + *                   texture.
   1.563 + *  \param dstrect   A pointer to the destination rectangle, or NULL for the 
   1.564 + *                   entire rendering target.
   1.565 + *  
   1.566 + *  \return 0 on success, or -1 if there is no rendering context current, or the
   1.567 + *          driver doesn't support the requested operation.
   1.568 + */
   1.569 +extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Texture * texture,
   1.570 +                                           const SDL_Rect * srcrect,
   1.571 +                                           const SDL_Rect * dstrect);
   1.572 +
   1.573 +/**
   1.574 + *  \brief Read pixels from the current rendering target.
   1.575 + *  
   1.576 + *  \param rect   A pointer to the rectangle to read, or NULL for the entire 
   1.577 + *                render target.
   1.578 + *  \param format The desired format of the pixel data, or 0 to use the format
   1.579 + *                of the rendering target
   1.580 + *  \param pixels A pointer to be filled in with the pixel data
   1.581 + *  \param pitch  The pitch of the pixels parameter.
   1.582 + *  
   1.583 + *  \return 0 on success, or -1 if pixel reading is not supported.
   1.584 + *  
   1.585 + *  \warning This is a very slow operation, and should not be used frequently.
   1.586 + */
   1.587 +extern DECLSPEC int SDLCALL SDL_RenderReadPixels(const SDL_Rect * rect,
   1.588 +                                                 Uint32 format,
   1.589 +                                                 void *pixels, int pitch);
   1.590 +
   1.591 +/**
   1.592 + *  \brief Write pixels to the current rendering target.
   1.593 + *  
   1.594 + *  \param rect   A pointer to the rectangle to write, or NULL for the entire 
   1.595 + *                render target.
   1.596 + *  \param format The format of the pixel data, or 0 to use the format
   1.597 + *                of the rendering target
   1.598 + *  \param pixels A pointer to the pixel data to write.
   1.599 + *  \param pitch  The pitch of the pixels parameter.
   1.600 + *  
   1.601 + *  \return 0 on success, or -1 if pixel writing is not supported.
   1.602 + *  
   1.603 + *  \warning This is a very slow operation, and should not be used frequently.
   1.604 + */
   1.605 +extern DECLSPEC int SDLCALL SDL_RenderWritePixels(const SDL_Rect * rect,
   1.606 +                                                  Uint32 format,
   1.607 +                                                  const void *pixels,
   1.608 +                                                  int pitch);
   1.609 +
   1.610 +/**
   1.611 + *  \brief Update the screen with rendering performed.
   1.612 + */
   1.613 +extern DECLSPEC void SDLCALL SDL_RenderPresent(void);
   1.614 +
   1.615 +/**
   1.616 + *  \brief Destroy the specified texture.
   1.617 + *  
   1.618 + *  \sa SDL_CreateTexture()
   1.619 + *  \sa SDL_CreateTextureFromSurface()
   1.620 + */
   1.621 +extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture);
   1.622 +
   1.623 +/**
   1.624 + *  \brief Destroy the rendering context for a window and free associated
   1.625 + *         textures.
   1.626 + *  
   1.627 + *  \sa SDL_CreateRenderer()
   1.628 + */
   1.629 +extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Window * window);
   1.630 +
   1.631 +
   1.632 +/* Ends C function definitions when using C++ */
   1.633 +#ifdef __cplusplus
   1.634 +/* *INDENT-OFF* */
   1.635 +}
   1.636 +/* *INDENT-ON* */
   1.637 +#endif
   1.638 +#include "close_code.h"
   1.639 +
   1.640 +#endif /* _SDL_render_h */
   1.641 +
   1.642 +/* vi: set ts=4 sw=4 expandtab: */