Split the rendering API out into a separate header file.
authorSam Lantinga <slouken@libsdl.org>
Tue, 01 Feb 2011 15:02:21 -0800
changeset 51452f44e6969a59
parent 5144 a1345acf7b3d
child 5146 3052772b59db
Split the rendering API out into a separate header file.
Makefile.in
include/SDL.h
include/SDL_compat.h
include/SDL_render.h
include/SDL_video.h
src/video/SDL_sysvideo.h
     1.1 --- a/Makefile.in	Tue Feb 01 12:54:27 2011 -0800
     1.2 +++ b/Makefile.in	Tue Feb 01 15:02:21 2011 -0800
     1.3 @@ -69,6 +69,7 @@
     1.4  	SDL_power.h \
     1.5  	SDL_quit.h \
     1.6  	SDL_rect.h \
     1.7 +	SDL_render.h \
     1.8  	SDL_revision.h \
     1.9  	SDL_rwops.h \
    1.10  	SDL_scancode.h \
     2.1 --- a/include/SDL.h	Tue Feb 01 12:54:27 2011 -0800
     2.2 +++ b/include/SDL.h	Tue Feb 01 15:02:21 2011 -0800
     2.3 @@ -86,6 +86,7 @@
     2.4  #include "SDL_loadso.h"
     2.5  #include "SDL_mutex.h"
     2.6  #include "SDL_power.h"
     2.7 +#include "SDL_render.h"
     2.8  #include "SDL_rwops.h"
     2.9  #include "SDL_thread.h"
    2.10  #include "SDL_timer.h"
     3.1 --- a/include/SDL_compat.h	Tue Feb 01 12:54:27 2011 -0800
     3.2 +++ b/include/SDL_compat.h	Tue Feb 01 15:02:21 2011 -0800
     3.3 @@ -328,7 +328,6 @@
     3.4  extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval);
     3.5  extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable);
     3.6  
     3.7 -typedef SDL_Texture* SDL_TextureID;
     3.8  typedef SDL_Window* SDL_WindowID;
     3.9  
    3.10  #define SDL_RenderPoint SDL_RenderDrawPoint
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/include/SDL_render.h	Tue Feb 01 15:02:21 2011 -0800
     4.3 @@ -0,0 +1,639 @@
     4.4 +/*
     4.5 +    SDL - Simple DirectMedia Layer
     4.6 +    Copyright (C) 1997-2010 Sam Lantinga
     4.7 +
     4.8 +    This library is free software; you can redistribute it and/or
     4.9 +    modify it under the terms of the GNU Lesser General Public
    4.10 +    License as published by the Free Software Foundation; either
    4.11 +    version 2.1 of the License, or (at your option) any later version.
    4.12 +
    4.13 +    This library is distributed in the hope that it will be useful,
    4.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    4.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    4.16 +    Lesser General Public License for more details.
    4.17 +
    4.18 +    You should have received a copy of the GNU Lesser General Public
    4.19 +    License along with this library; if not, write to the Free Software
    4.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    4.21 +
    4.22 +    Sam Lantinga
    4.23 +    slouken@libsdl.org
    4.24 +*/
    4.25 +
    4.26 +/**
    4.27 + *  \file SDL_render.h
    4.28 + *  
    4.29 + *  Header file for SDL 2D rendering functions.
    4.30 + */
    4.31 +
    4.32 +#ifndef _SDL_render_h
    4.33 +#define _SDL_render_h
    4.34 +
    4.35 +#include "SDL_stdinc.h"
    4.36 +//#include "SDL_pixels.h"
    4.37 +#include "SDL_rect.h"
    4.38 +#include "SDL_video.h"
    4.39 +
    4.40 +#include "begin_code.h"
    4.41 +/* Set up for C function definitions, even when using C++ */
    4.42 +#ifdef __cplusplus
    4.43 +/* *INDENT-OFF* */
    4.44 +extern "C" {
    4.45 +/* *INDENT-ON* */
    4.46 +#endif
    4.47 +
    4.48 +/**
    4.49 + *  \brief Flags used when creating a rendering context
    4.50 + */
    4.51 +typedef enum
    4.52 +{
    4.53 +    SDL_RENDERER_ACCELERATED = 0x00000001,      /**< The renderer uses hardware 
    4.54 +                                                     acceleration */
    4.55 +    SDL_RENDERER_PRESENTVSYNC = 0x00000002      /**< Present is synchronized 
    4.56 +                                                     with the refresh rate */
    4.57 +} SDL_RendererFlags;
    4.58 +
    4.59 +/**
    4.60 + *  \brief Information on the capabilities of a render driver or context.
    4.61 + */
    4.62 +typedef struct SDL_RendererInfo
    4.63 +{
    4.64 +    const char *name;           /**< The name of the renderer */
    4.65 +    Uint32 flags;               /**< Supported ::SDL_RendererFlags */
    4.66 +    Uint32 num_texture_formats; /**< The number of available texture formats */
    4.67 +    Uint32 texture_formats[50]; /**< The available texture formats */
    4.68 +    int max_texture_width;      /**< The maximimum texture width */
    4.69 +    int max_texture_height;     /**< The maximimum texture height */
    4.70 +} SDL_RendererInfo;
    4.71 +
    4.72 +/**
    4.73 + *  \brief The access pattern allowed for a texture.
    4.74 + */
    4.75 +typedef enum
    4.76 +{
    4.77 +    SDL_TEXTUREACCESS_STATIC,    /**< Changes rarely, not lockable */
    4.78 +    SDL_TEXTUREACCESS_STREAMING  /**< Changes frequently, lockable */
    4.79 +} SDL_TextureAccess;
    4.80 +
    4.81 +/**
    4.82 + *  \brief The texture channel modulation used in SDL_RenderCopy().
    4.83 + */
    4.84 +typedef enum
    4.85 +{
    4.86 +    SDL_TEXTUREMODULATE_NONE = 0x00000000,     /**< No modulation */
    4.87 +    SDL_TEXTUREMODULATE_COLOR = 0x00000001,    /**< srcC = srcC * color */
    4.88 +    SDL_TEXTUREMODULATE_ALPHA = 0x00000002     /**< srcA = srcA * alpha */
    4.89 +} SDL_TextureModulate;
    4.90 +
    4.91 +/**
    4.92 + *  \brief An efficient driver-specific representation of pixel data
    4.93 + */
    4.94 +struct SDL_Texture;
    4.95 +typedef struct SDL_Texture SDL_Texture;
    4.96 +
    4.97 +
    4.98 +/* Function prototypes */
    4.99 +
   4.100 +/**
   4.101 + *  \brief Get the number of 2D rendering drivers available for the current 
   4.102 + *         display.
   4.103 + *  
   4.104 + *  A render driver is a set of code that handles rendering and texture
   4.105 + *  management on a particular display.  Normally there is only one, but
   4.106 + *  some drivers may have several available with different capabilities.
   4.107 + *  
   4.108 + *  \sa SDL_GetRenderDriverInfo()
   4.109 + *  \sa SDL_CreateRenderer()
   4.110 + */
   4.111 +extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
   4.112 +
   4.113 +/**
   4.114 + *  \brief Get information about a specific 2D rendering driver for the current 
   4.115 + *         display.
   4.116 + *  
   4.117 + *  \param index The index of the driver to query information about.
   4.118 + *  \param info  A pointer to an SDL_RendererInfo struct to be filled with 
   4.119 + *               information on the rendering driver.
   4.120 + *  
   4.121 + *  \return 0 on success, -1 if the index was out of range.
   4.122 + *  
   4.123 + *  \sa SDL_CreateRenderer()
   4.124 + */
   4.125 +extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index,
   4.126 +                                                    SDL_RendererInfo * info);
   4.127 +
   4.128 +/**
   4.129 + *  \brief Create and make active a 2D rendering context for a window.
   4.130 + *  
   4.131 + *  \param window The window where rendering is displayed.
   4.132 + *  \param index    The index of the rendering driver to initialize, or -1 to 
   4.133 + *                  initialize the first one supporting the requested flags.
   4.134 + *  \param flags    ::SDL_RendererFlags.
   4.135 + *  
   4.136 + *  \return 0 on success, -1 if there was an error creating the renderer.
   4.137 + *  
   4.138 + *  \sa SDL_SelectRenderer()
   4.139 + *  \sa SDL_GetRendererInfo()
   4.140 + *  \sa SDL_DestroyRenderer()
   4.141 + */
   4.142 +extern DECLSPEC int SDLCALL SDL_CreateRenderer(SDL_Window * window,
   4.143 +                                               int index, Uint32 flags);
   4.144 +
   4.145 +/**
   4.146 + *  \brief Select the rendering context for a particular window.
   4.147 + *  
   4.148 + *  \return 0 on success, -1 if the selected window doesn't have a
   4.149 + *          rendering context.
   4.150 + */
   4.151 +extern DECLSPEC int SDLCALL SDL_SelectRenderer(SDL_Window * window);
   4.152 +
   4.153 +/**
   4.154 + *  \brief Get information about the current rendering context.
   4.155 + */
   4.156 +extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_RendererInfo * info);
   4.157 +
   4.158 +/**
   4.159 + *  \brief Create a texture for the current rendering context.
   4.160 + *  
   4.161 + *  \param format The format of the texture.
   4.162 + *  \param access One of the enumerated values in ::SDL_TextureAccess.
   4.163 + *  \param w      The width of the texture in pixels.
   4.164 + *  \param h      The height of the texture in pixels.
   4.165 + *  
   4.166 + *  \return The created texture is returned, or 0 if no rendering context was 
   4.167 + *          active,  the format was unsupported, or the width or height were out
   4.168 + *          of range.
   4.169 + *  
   4.170 + *  \sa SDL_QueryTexture()
   4.171 + *  \sa SDL_DestroyTexture()
   4.172 + */
   4.173 +extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(Uint32 format,
   4.174 +                                                        int access, int w,
   4.175 +                                                        int h);
   4.176 +
   4.177 +/**
   4.178 + *  \brief Create a texture from an existing surface.
   4.179 + *  
   4.180 + *  \param format The format of the texture, or 0 to pick an appropriate format.
   4.181 + *  \param surface The surface containing pixel data used to fill the texture.
   4.182 + *  
   4.183 + *  \return The created texture is returned, or 0 if no rendering context was 
   4.184 + *          active,  the format was unsupported, or the surface width or height 
   4.185 + *          were out of range.
   4.186 + *  
   4.187 + *  \note The surface is not modified or freed by this function.
   4.188 + *  
   4.189 + *  \sa SDL_QueryTexture()
   4.190 + *  \sa SDL_DestroyTexture()
   4.191 + */
   4.192 +extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(Uint32
   4.193 +                                                                   format,
   4.194 +                                                                   SDL_Surface
   4.195 +                                                                   * surface);
   4.196 +
   4.197 +/**
   4.198 + *  \brief Query the attributes of a texture
   4.199 + *  
   4.200 + *  \param texture A texture to be queried.
   4.201 + *  \param format  A pointer filled in with the raw format of the texture.  The 
   4.202 + *                 actual format may differ, but pixel transfers will use this 
   4.203 + *                 format.
   4.204 + *  \param access  A pointer filled in with the actual access to the texture.
   4.205 + *  \param w       A pointer filled in with the width of the texture in pixels.
   4.206 + *  \param h       A pointer filled in with the height of the texture in pixels.
   4.207 + *  
   4.208 + *  \return 0 on success, or -1 if the texture is not valid.
   4.209 + */
   4.210 +extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture,
   4.211 +                                             Uint32 * format, int *access,
   4.212 +                                             int *w, int *h);
   4.213 +
   4.214 +/**
   4.215 + *  \brief Query the pixels of a texture, if the texture does not need to be 
   4.216 + *         locked for pixel access.
   4.217 + *  
   4.218 + *  \param texture A texture to be queried, which was created with 
   4.219 + *                   ::SDL_TEXTUREACCESS_STREAMING.
   4.220 + *  \param pixels    A pointer filled with a pointer to the pixels for the 
   4.221 + *                   texture.
   4.222 + *  \param pitch     A pointer filled in with the pitch of the pixel data.
   4.223 + *  
   4.224 + *  \return 0 on success, or -1 if the texture is not valid, or must be locked 
   4.225 + *          for pixel access.
   4.226 + */
   4.227 +extern DECLSPEC int SDLCALL SDL_QueryTexturePixels(SDL_Texture * texture,
   4.228 +                                                   void **pixels, int *pitch);
   4.229 +
   4.230 +/**
   4.231 + *  \brief Set the color palette of an indexed texture.
   4.232 + *  
   4.233 + *  \param texture  The texture to update.
   4.234 + *  \param colors     The array of RGB color data.
   4.235 + *  \param firstcolor The first index to update.
   4.236 + *  \param ncolors    The number of palette entries to fill with the color data.
   4.237 + *  
   4.238 + *  \return 0 on success, or -1 if the texture is not valid or not an indexed 
   4.239 + *          texture.
   4.240 + */
   4.241 +extern DECLSPEC int SDLCALL SDL_SetTexturePalette(SDL_Texture * texture,
   4.242 +                                                  const SDL_Color * colors,
   4.243 +                                                  int firstcolor,
   4.244 +                                                  int ncolors);
   4.245 +
   4.246 +/**
   4.247 + *  \brief Get the color palette from an indexed texture if it has one.
   4.248 + *  
   4.249 + *  \param texture  The texture to update.
   4.250 + *  \param colors     The array to fill with RGB color data.
   4.251 + *  \param firstcolor The first index to retrieve.
   4.252 + *  \param ncolors    The number of palette entries to retrieve.
   4.253 + *  
   4.254 + *  \return 0 on success, or -1 if the texture is not valid or not an indexed 
   4.255 + *          texture.
   4.256 + */
   4.257 +extern DECLSPEC int SDLCALL SDL_GetTexturePalette(SDL_Texture * texture,
   4.258 +                                                  SDL_Color * colors,
   4.259 +                                                  int firstcolor,
   4.260 +                                                  int ncolors);
   4.261 +
   4.262 +/**
   4.263 + *  \brief Set an additional color value used in render copy operations.
   4.264 + *  
   4.265 + *  \param texture The texture to update.
   4.266 + *  \param r       The red color value multiplied into copy operations.
   4.267 + *  \param g       The green color value multiplied into copy operations.
   4.268 + *  \param b       The blue color value multiplied into copy operations.
   4.269 + *  
   4.270 + *  \return 0 on success, or -1 if the texture is not valid or color modulation 
   4.271 + *          is not supported.
   4.272 + *  
   4.273 + *  \sa SDL_GetTextureColorMod()
   4.274 + */
   4.275 +extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture,
   4.276 +                                                   Uint8 r, Uint8 g, Uint8 b);
   4.277 +
   4.278 +
   4.279 +/**
   4.280 + *  \brief Get the additional color value used in render copy operations.
   4.281 + *  
   4.282 + *  \param texture The texture to query.
   4.283 + *  \param r         A pointer filled in with the current red color value.
   4.284 + *  \param g         A pointer filled in with the current green color value.
   4.285 + *  \param b         A pointer filled in with the current blue color value.
   4.286 + *  
   4.287 + *  \return 0 on success, or -1 if the texture is not valid.
   4.288 + *  
   4.289 + *  \sa SDL_SetTextureColorMod()
   4.290 + */
   4.291 +extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture,
   4.292 +                                                   Uint8 * r, Uint8 * g,
   4.293 +                                                   Uint8 * b);
   4.294 +
   4.295 +/**
   4.296 + *  \brief Set an additional alpha value used in render copy operations.
   4.297 + *  
   4.298 + *  \param texture The texture to update.
   4.299 + *  \param alpha     The alpha value multiplied into copy operations.
   4.300 + *  
   4.301 + *  \return 0 on success, or -1 if the texture is not valid or alpha modulation 
   4.302 + *          is not supported.
   4.303 + *  
   4.304 + *  \sa SDL_GetTextureAlphaMod()
   4.305 + */
   4.306 +extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture,
   4.307 +                                                   Uint8 alpha);
   4.308 +
   4.309 +/**
   4.310 + *  \brief Get the additional alpha value used in render copy operations.
   4.311 + *  
   4.312 + *  \param texture The texture to query.
   4.313 + *  \param alpha     A pointer filled in with the current alpha value.
   4.314 + *  
   4.315 + *  \return 0 on success, or -1 if the texture is not valid.
   4.316 + *  
   4.317 + *  \sa SDL_SetTextureAlphaMod()
   4.318 + */
   4.319 +extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture,
   4.320 +                                                   Uint8 * alpha);
   4.321 +
   4.322 +/**
   4.323 + *  \brief Set the blend mode used for texture copy operations.
   4.324 + *  
   4.325 + *  \param texture The texture to update.
   4.326 + *  \param blendMode ::SDL_BlendMode to use for texture blending.
   4.327 + *  
   4.328 + *  \return 0 on success, or -1 if the texture is not valid or the blend mode is
   4.329 + *          not supported.
   4.330 + *  
   4.331 + *  \note If the blend mode is not supported, the closest supported mode is
   4.332 + *        chosen.
   4.333 + *  
   4.334 + *  \sa SDL_GetTextureBlendMode()
   4.335 + */
   4.336 +extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture,
   4.337 +                                                    SDL_BlendMode blendMode);
   4.338 +
   4.339 +/**
   4.340 + *  \brief Get the blend mode used for texture copy operations.
   4.341 + *  
   4.342 + *  \param texture The texture to query.
   4.343 + *  \param blendMode A pointer filled in with the current blend mode.
   4.344 + *  
   4.345 + *  \return 0 on success, or -1 if the texture is not valid.
   4.346 + *  
   4.347 + *  \sa SDL_SetTextureBlendMode()
   4.348 + */
   4.349 +extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture,
   4.350 +                                                    SDL_BlendMode *blendMode);
   4.351 +
   4.352 +/**
   4.353 + *  \brief Update the given texture rectangle with new pixel data.
   4.354 + *  
   4.355 + *  \param texture The texture to update
   4.356 + *  \param rect      A pointer to the rectangle of pixels to update, or NULL to 
   4.357 + *                   update the entire texture.
   4.358 + *  \param pixels    The raw pixel data.
   4.359 + *  \param pitch     The number of bytes between rows of pixel data.
   4.360 + *  
   4.361 + *  \return 0 on success, or -1 if the texture is not valid.
   4.362 + *  
   4.363 + *  \note This is a fairly slow function.
   4.364 + */
   4.365 +extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture,
   4.366 +                                              const SDL_Rect * rect,
   4.367 +                                              const void *pixels, int pitch);
   4.368 +
   4.369 +/**
   4.370 + *  \brief Lock a portion of the texture for pixel access.
   4.371 + *  
   4.372 + *  \param texture The texture to lock for access, which was created with 
   4.373 + *                   ::SDL_TEXTUREACCESS_STREAMING.
   4.374 + *  \param rect      A pointer to the rectangle to lock for access. If the rect 
   4.375 + *                   is NULL, the entire texture will be locked.
   4.376 + *  \param markDirty If this is nonzero, the locked area will be marked dirty 
   4.377 + *                   when the texture is unlocked.
   4.378 + *  \param pixels    This is filled in with a pointer to the locked pixels, 
   4.379 + *                   appropriately offset by the locked area.
   4.380 + *  \param pitch     This is filled in with the pitch of the locked pixels.
   4.381 + *  
   4.382 + *  \return 0 on success, or -1 if the texture is not valid or was created with 
   4.383 + *          ::SDL_TEXTUREACCESS_STATIC.
   4.384 + *  
   4.385 + *  \sa SDL_DirtyTexture()
   4.386 + *  \sa SDL_UnlockTexture()
   4.387 + */
   4.388 +extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture,
   4.389 +                                            const SDL_Rect * rect,
   4.390 +                                            int markDirty, void **pixels,
   4.391 +                                            int *pitch);
   4.392 +
   4.393 +/**
   4.394 + *  \brief Unlock a texture, uploading the changes to renderer memory, if needed.
   4.395 + *  
   4.396 + *  \sa SDL_LockTexture()
   4.397 + *  \sa SDL_DirtyTexture()
   4.398 + */
   4.399 +extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture);
   4.400 +
   4.401 +/**
   4.402 + *  \brief Mark the specified rectangles of the texture as dirty.
   4.403 + *  
   4.404 + *  \param texture The texture to mark dirty, which was created with 
   4.405 + *                   ::SDL_TEXTUREACCESS_STREAMING.
   4.406 + *  \param numrects  The number of rectangles pointed to by rects.
   4.407 + *  \param rects     The pointer to an array of dirty rectangles.
   4.408 + *  
   4.409 + *  \sa SDL_LockTexture()
   4.410 + *  \sa SDL_UnlockTexture()
   4.411 + */
   4.412 +extern DECLSPEC void SDLCALL SDL_DirtyTexture(SDL_Texture * texture,
   4.413 +                                              int numrects,
   4.414 +                                              const SDL_Rect * rects);
   4.415 +
   4.416 +/**
   4.417 + *  \brief Set the color used for drawing operations (Fill and Line).
   4.418 + *  
   4.419 + *  \param r The red value used to draw on the rendering target.
   4.420 + *  \param g The green value used to draw on the rendering target.
   4.421 + *  \param b The blue value used to draw on the rendering target.
   4.422 + *  \param a The alpha value used to draw on the rendering target, usually 
   4.423 + *           ::SDL_ALPHA_OPAQUE (255).
   4.424 + *  
   4.425 + *  \return 0 on success, or -1 if there is no rendering context current.
   4.426 + */
   4.427 +extern DECLSPEC int SDL_SetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b,
   4.428 +                                           Uint8 a);
   4.429 +
   4.430 +/**
   4.431 + *  \brief Get the color used for drawing operations (Fill and Line).
   4.432 + *  
   4.433 + *  \param r A pointer to the red value used to draw on the rendering target.
   4.434 + *  \param g A pointer to the green value used to draw on the rendering target.
   4.435 + *  \param b A pointer to the blue value used to draw on the rendering target.
   4.436 + *  \param a A pointer to the alpha value used to draw on the rendering target, 
   4.437 + *           usually ::SDL_ALPHA_OPAQUE (255).
   4.438 + *  
   4.439 + *  \return 0 on success, or -1 if there is no rendering context current.
   4.440 + */
   4.441 +extern DECLSPEC int SDL_GetRenderDrawColor(Uint8 * r, Uint8 * g, Uint8 * b,
   4.442 +                                           Uint8 * a);
   4.443 +
   4.444 +/**
   4.445 + *  \brief Set the blend mode used for drawing operations (Fill and Line).
   4.446 + *  
   4.447 + *  \param blendMode ::SDL_BlendMode to use for blending.
   4.448 + *  
   4.449 + *  \return 0 on success, or -1 if there is no rendering context current.
   4.450 + *  
   4.451 + *  \note If the blend mode is not supported, the closest supported mode is 
   4.452 + *        chosen.
   4.453 + *  
   4.454 + *  \sa SDL_GetRenderDrawBlendMode()
   4.455 + */
   4.456 +extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_BlendMode blendMode);
   4.457 +
   4.458 +/**
   4.459 + *  \brief Get the blend mode used for drawing operations.
   4.460 + *  
   4.461 + *  \param blendMode A pointer filled in with the current blend mode.
   4.462 + *  
   4.463 + *  \return 0 on success, or -1 if there is no rendering context current.
   4.464 + *  
   4.465 + *  \sa SDL_SetRenderDrawBlendMode()
   4.466 + */
   4.467 +extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_BlendMode *blendMode);
   4.468 +
   4.469 +/**
   4.470 + *  \brief Clear the current rendering target with the drawing color
   4.471 + */
   4.472 +extern DECLSPEC int SDLCALL SDL_RenderClear(void);
   4.473 +
   4.474 +/**
   4.475 + *  \brief Draw a point on the current rendering target.
   4.476 + *  
   4.477 + *  \param x The x coordinate of the point.
   4.478 + *  \param y The y coordinate of the point.
   4.479 + *  
   4.480 + *  \return 0 on success, or -1 if there is no rendering context current.
   4.481 + */
   4.482 +extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(int x, int y);
   4.483 +
   4.484 +/**
   4.485 + *  \brief Draw multiple points on the current rendering target.
   4.486 + *  
   4.487 + *  \param points The points to draw
   4.488 + *  \param count The number of points to draw
   4.489 + *  
   4.490 + *  \return 0 on success, or -1 if there is no rendering context current.
   4.491 + */
   4.492 +extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(const SDL_Point * points,
   4.493 +                                                 int count);
   4.494 +
   4.495 +/**
   4.496 + *  \brief Draw a line on the current rendering target.
   4.497 + *  
   4.498 + *  \param x1 The x coordinate of the start point.
   4.499 + *  \param y1 The y coordinate of the start point.
   4.500 + *  \param x2 The x coordinate of the end point.
   4.501 + *  \param y2 The y coordinate of the end point.
   4.502 + *  
   4.503 + *  \return 0 on success, or -1 if there is no rendering context current.
   4.504 + */
   4.505 +extern DECLSPEC int SDLCALL SDL_RenderDrawLine(int x1, int y1, int x2, int y2);
   4.506 +
   4.507 +/**
   4.508 + *  \brief Draw a series of connected lines on the current rendering target.
   4.509 + *  
   4.510 + *  \param points The points along the lines
   4.511 + *  \param count The number of points, drawing count-1 lines
   4.512 + *  
   4.513 + *  \return 0 on success, or -1 if there is no rendering context current.
   4.514 + */
   4.515 +extern DECLSPEC int SDLCALL SDL_RenderDrawLines(const SDL_Point * points,
   4.516 +                                                int count);
   4.517 +
   4.518 +/**
   4.519 + *  \brief Draw a rectangle on the current rendering target.
   4.520 + *  
   4.521 + *  \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
   4.522 + *  
   4.523 + *  \return 0 on success, or -1 if there is no rendering context current.
   4.524 + */
   4.525 +extern DECLSPEC int SDLCALL SDL_RenderDrawRect(const SDL_Rect * rect);
   4.526 +
   4.527 +/**
   4.528 + *  \brief Draw some number of rectangles on the current rendering target.
   4.529 + *  
   4.530 + *  \param rects A pointer to an array of destination rectangles.
   4.531 + *  \param count The number of rectangles.
   4.532 + *  
   4.533 + *  \return 0 on success, or -1 if there is no rendering context current.
   4.534 + */
   4.535 +extern DECLSPEC int SDLCALL SDL_RenderDrawRects(const SDL_Rect ** rects, int count);
   4.536 +
   4.537 +/**
   4.538 + *  \brief Fill a rectangle on the current rendering target with the drawing color.
   4.539 + *  
   4.540 + *  \param rect A pointer to the destination rectangle, or NULL for the entire 
   4.541 + *              rendering target.
   4.542 + *  
   4.543 + *  \return 0 on success, or -1 if there is no rendering context current.
   4.544 + */
   4.545 +extern DECLSPEC int SDLCALL SDL_RenderFillRect(const SDL_Rect * rect);
   4.546 +
   4.547 +/**
   4.548 + *  \brief Fill some number of rectangles on the current rendering target with the drawing color.
   4.549 + *  
   4.550 + *  \param rects A pointer to an array of destination rectangles.
   4.551 + *  \param count The number of rectangles.
   4.552 + *  
   4.553 + *  \return 0 on success, or -1 if there is no rendering context current.
   4.554 + */
   4.555 +extern DECLSPEC int SDLCALL SDL_RenderFillRects(const SDL_Rect ** rect, int count);
   4.556 +
   4.557 +/**
   4.558 + *  \brief Copy a portion of the texture to the current rendering target.
   4.559 + *  
   4.560 + *  \param texture The source texture.
   4.561 + *  \param srcrect   A pointer to the source rectangle, or NULL for the entire 
   4.562 + *                   texture.
   4.563 + *  \param dstrect   A pointer to the destination rectangle, or NULL for the 
   4.564 + *                   entire rendering target.
   4.565 + *  
   4.566 + *  \return 0 on success, or -1 if there is no rendering context current, or the
   4.567 + *          driver doesn't support the requested operation.
   4.568 + */
   4.569 +extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Texture * texture,
   4.570 +                                           const SDL_Rect * srcrect,
   4.571 +                                           const SDL_Rect * dstrect);
   4.572 +
   4.573 +/**
   4.574 + *  \brief Read pixels from the current rendering target.
   4.575 + *  
   4.576 + *  \param rect   A pointer to the rectangle to read, or NULL for the entire 
   4.577 + *                render target.
   4.578 + *  \param format The desired format of the pixel data, or 0 to use the format
   4.579 + *                of the rendering target
   4.580 + *  \param pixels A pointer to be filled in with the pixel data
   4.581 + *  \param pitch  The pitch of the pixels parameter.
   4.582 + *  
   4.583 + *  \return 0 on success, or -1 if pixel reading is not supported.
   4.584 + *  
   4.585 + *  \warning This is a very slow operation, and should not be used frequently.
   4.586 + */
   4.587 +extern DECLSPEC int SDLCALL SDL_RenderReadPixels(const SDL_Rect * rect,
   4.588 +                                                 Uint32 format,
   4.589 +                                                 void *pixels, int pitch);
   4.590 +
   4.591 +/**
   4.592 + *  \brief Write pixels to the current rendering target.
   4.593 + *  
   4.594 + *  \param rect   A pointer to the rectangle to write, or NULL for the entire 
   4.595 + *                render target.
   4.596 + *  \param format The format of the pixel data, or 0 to use the format
   4.597 + *                of the rendering target
   4.598 + *  \param pixels A pointer to the pixel data to write.
   4.599 + *  \param pitch  The pitch of the pixels parameter.
   4.600 + *  
   4.601 + *  \return 0 on success, or -1 if pixel writing is not supported.
   4.602 + *  
   4.603 + *  \warning This is a very slow operation, and should not be used frequently.
   4.604 + */
   4.605 +extern DECLSPEC int SDLCALL SDL_RenderWritePixels(const SDL_Rect * rect,
   4.606 +                                                  Uint32 format,
   4.607 +                                                  const void *pixels,
   4.608 +                                                  int pitch);
   4.609 +
   4.610 +/**
   4.611 + *  \brief Update the screen with rendering performed.
   4.612 + */
   4.613 +extern DECLSPEC void SDLCALL SDL_RenderPresent(void);
   4.614 +
   4.615 +/**
   4.616 + *  \brief Destroy the specified texture.
   4.617 + *  
   4.618 + *  \sa SDL_CreateTexture()
   4.619 + *  \sa SDL_CreateTextureFromSurface()
   4.620 + */
   4.621 +extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture);
   4.622 +
   4.623 +/**
   4.624 + *  \brief Destroy the rendering context for a window and free associated
   4.625 + *         textures.
   4.626 + *  
   4.627 + *  \sa SDL_CreateRenderer()
   4.628 + */
   4.629 +extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Window * window);
   4.630 +
   4.631 +
   4.632 +/* Ends C function definitions when using C++ */
   4.633 +#ifdef __cplusplus
   4.634 +/* *INDENT-OFF* */
   4.635 +}
   4.636 +/* *INDENT-ON* */
   4.637 +#endif
   4.638 +#include "close_code.h"
   4.639 +
   4.640 +#endif /* _SDL_render_h */
   4.641 +
   4.642 +/* vi: set ts=4 sw=4 expandtab: */
     5.1 --- a/include/SDL_video.h	Tue Feb 01 12:54:27 2011 -0800
     5.2 +++ b/include/SDL_video.h	Tue Feb 01 15:02:21 2011 -0800
     5.3 @@ -32,7 +32,6 @@
     5.4  #include "SDL_stdinc.h"
     5.5  #include "SDL_pixels.h"
     5.6  #include "SDL_rect.h"
     5.7 -#include "SDL_blendmode.h"
     5.8  #include "SDL_surface.h"
     5.9  
    5.10  #include "begin_code.h"
    5.11 @@ -147,55 +146,6 @@
    5.12  } SDL_WindowEventID;
    5.13  
    5.14  /**
    5.15 - *  \brief Flags used when creating a rendering context
    5.16 - */
    5.17 -typedef enum
    5.18 -{
    5.19 -    SDL_RENDERER_ACCELERATED = 0x00000001,      /**< The renderer uses hardware 
    5.20 -                                                     acceleration */
    5.21 -    SDL_RENDERER_PRESENTVSYNC = 0x00000002      /**< Present is synchronized 
    5.22 -                                                     with the refresh rate */
    5.23 -} SDL_RendererFlags;
    5.24 -
    5.25 -/**
    5.26 - *  \brief Information on the capabilities of a render driver or context.
    5.27 - */
    5.28 -typedef struct SDL_RendererInfo
    5.29 -{
    5.30 -    const char *name;           /**< The name of the renderer */
    5.31 -    Uint32 flags;               /**< Supported ::SDL_RendererFlags */
    5.32 -    Uint32 num_texture_formats; /**< The number of available texture formats */
    5.33 -    Uint32 texture_formats[50]; /**< The available texture formats */
    5.34 -    int max_texture_width;      /**< The maximimum texture width */
    5.35 -    int max_texture_height;     /**< The maximimum texture height */
    5.36 -} SDL_RendererInfo;
    5.37 -
    5.38 -/**
    5.39 - *  \brief The access pattern allowed for a texture.
    5.40 - */
    5.41 -typedef enum
    5.42 -{
    5.43 -    SDL_TEXTUREACCESS_STATIC,    /**< Changes rarely, not lockable */
    5.44 -    SDL_TEXTUREACCESS_STREAMING  /**< Changes frequently, lockable */
    5.45 -} SDL_TextureAccess;
    5.46 -
    5.47 -/**
    5.48 - *  \brief The texture channel modulation used in SDL_RenderCopy().
    5.49 - */
    5.50 -typedef enum
    5.51 -{
    5.52 -    SDL_TEXTUREMODULATE_NONE = 0x00000000,     /**< No modulation */
    5.53 -    SDL_TEXTUREMODULATE_COLOR = 0x00000001,    /**< srcC = srcC * color */
    5.54 -    SDL_TEXTUREMODULATE_ALPHA = 0x00000002     /**< srcA = srcA * alpha */
    5.55 -} SDL_TextureModulate;
    5.56 -
    5.57 -/**
    5.58 - *  \brief An efficient driver-specific representation of pixel data
    5.59 - */
    5.60 -struct SDL_Texture;
    5.61 -typedef struct SDL_Texture SDL_Texture;
    5.62 -
    5.63 -/**
    5.64   *  \brief An opaque handle to an OpenGL context.
    5.65   */
    5.66  typedef void *SDL_GLContext;
    5.67 @@ -690,536 +640,6 @@
    5.68   */
    5.69  extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window * window);
    5.70  
    5.71 -/**
    5.72 - *  \brief Get the number of 2D rendering drivers available for the current 
    5.73 - *         display.
    5.74 - *  
    5.75 - *  A render driver is a set of code that handles rendering and texture
    5.76 - *  management on a particular display.  Normally there is only one, but
    5.77 - *  some drivers may have several available with different capabilities.
    5.78 - *  
    5.79 - *  \sa SDL_GetRenderDriverInfo()
    5.80 - *  \sa SDL_CreateRenderer()
    5.81 - */
    5.82 -extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
    5.83 -
    5.84 -/**
    5.85 - *  \brief Get information about a specific 2D rendering driver for the current 
    5.86 - *         display.
    5.87 - *  
    5.88 - *  \param index The index of the driver to query information about.
    5.89 - *  \param info  A pointer to an SDL_RendererInfo struct to be filled with 
    5.90 - *               information on the rendering driver.
    5.91 - *  
    5.92 - *  \return 0 on success, -1 if the index was out of range.
    5.93 - *  
    5.94 - *  \sa SDL_CreateRenderer()
    5.95 - */
    5.96 -extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index,
    5.97 -                                                    SDL_RendererInfo * info);
    5.98 -
    5.99 -/**
   5.100 - *  \brief Create and make active a 2D rendering context for a window.
   5.101 - *  
   5.102 - *  \param window The window where rendering is displayed.
   5.103 - *  \param index    The index of the rendering driver to initialize, or -1 to 
   5.104 - *                  initialize the first one supporting the requested flags.
   5.105 - *  \param flags    ::SDL_RendererFlags.
   5.106 - *  
   5.107 - *  \return 0 on success, -1 if there was an error creating the renderer.
   5.108 - *  
   5.109 - *  \sa SDL_SelectRenderer()
   5.110 - *  \sa SDL_GetRendererInfo()
   5.111 - *  \sa SDL_DestroyRenderer()
   5.112 - */
   5.113 -extern DECLSPEC int SDLCALL SDL_CreateRenderer(SDL_Window * window,
   5.114 -                                               int index, Uint32 flags);
   5.115 -
   5.116 -/**
   5.117 - *  \brief Select the rendering context for a particular window.
   5.118 - *  
   5.119 - *  \return 0 on success, -1 if the selected window doesn't have a
   5.120 - *          rendering context.
   5.121 - */
   5.122 -extern DECLSPEC int SDLCALL SDL_SelectRenderer(SDL_Window * window);
   5.123 -
   5.124 -/**
   5.125 - *  \brief Get information about the current rendering context.
   5.126 - */
   5.127 -extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_RendererInfo * info);
   5.128 -
   5.129 -/**
   5.130 - *  \brief Create a texture for the current rendering context.
   5.131 - *  
   5.132 - *  \param format The format of the texture.
   5.133 - *  \param access One of the enumerated values in ::SDL_TextureAccess.
   5.134 - *  \param w      The width of the texture in pixels.
   5.135 - *  \param h      The height of the texture in pixels.
   5.136 - *  
   5.137 - *  \return The created texture is returned, or 0 if no rendering context was 
   5.138 - *          active,  the format was unsupported, or the width or height were out
   5.139 - *          of range.
   5.140 - *  
   5.141 - *  \sa SDL_QueryTexture()
   5.142 - *  \sa SDL_DestroyTexture()
   5.143 - */
   5.144 -extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(Uint32 format,
   5.145 -                                                        int access, int w,
   5.146 -                                                        int h);
   5.147 -
   5.148 -/**
   5.149 - *  \brief Create a texture from an existing surface.
   5.150 - *  
   5.151 - *  \param format The format of the texture, or 0 to pick an appropriate format.
   5.152 - *  \param surface The surface containing pixel data used to fill the texture.
   5.153 - *  
   5.154 - *  \return The created texture is returned, or 0 if no rendering context was 
   5.155 - *          active,  the format was unsupported, or the surface width or height 
   5.156 - *          were out of range.
   5.157 - *  
   5.158 - *  \note The surface is not modified or freed by this function.
   5.159 - *  
   5.160 - *  \sa SDL_QueryTexture()
   5.161 - *  \sa SDL_DestroyTexture()
   5.162 - */
   5.163 -extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(Uint32
   5.164 -                                                                   format,
   5.165 -                                                                   SDL_Surface
   5.166 -                                                                   * surface);
   5.167 -
   5.168 -/**
   5.169 - *  \brief Query the attributes of a texture
   5.170 - *  
   5.171 - *  \param texture A texture to be queried.
   5.172 - *  \param format  A pointer filled in with the raw format of the texture.  The 
   5.173 - *                 actual format may differ, but pixel transfers will use this 
   5.174 - *                 format.
   5.175 - *  \param access  A pointer filled in with the actual access to the texture.
   5.176 - *  \param w       A pointer filled in with the width of the texture in pixels.
   5.177 - *  \param h       A pointer filled in with the height of the texture in pixels.
   5.178 - *  
   5.179 - *  \return 0 on success, or -1 if the texture is not valid.
   5.180 - */
   5.181 -extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture,
   5.182 -                                             Uint32 * format, int *access,
   5.183 -                                             int *w, int *h);
   5.184 -
   5.185 -/**
   5.186 - *  \brief Query the pixels of a texture, if the texture does not need to be 
   5.187 - *         locked for pixel access.
   5.188 - *  
   5.189 - *  \param texture A texture to be queried, which was created with 
   5.190 - *                   ::SDL_TEXTUREACCESS_STREAMING.
   5.191 - *  \param pixels    A pointer filled with a pointer to the pixels for the 
   5.192 - *                   texture.
   5.193 - *  \param pitch     A pointer filled in with the pitch of the pixel data.
   5.194 - *  
   5.195 - *  \return 0 on success, or -1 if the texture is not valid, or must be locked 
   5.196 - *          for pixel access.
   5.197 - */
   5.198 -extern DECLSPEC int SDLCALL SDL_QueryTexturePixels(SDL_Texture * texture,
   5.199 -                                                   void **pixels, int *pitch);
   5.200 -
   5.201 -/**
   5.202 - *  \brief Set the color palette of an indexed texture.
   5.203 - *  
   5.204 - *  \param texture  The texture to update.
   5.205 - *  \param colors     The array of RGB color data.
   5.206 - *  \param firstcolor The first index to update.
   5.207 - *  \param ncolors    The number of palette entries to fill with the color data.
   5.208 - *  
   5.209 - *  \return 0 on success, or -1 if the texture is not valid or not an indexed 
   5.210 - *          texture.
   5.211 - */
   5.212 -extern DECLSPEC int SDLCALL SDL_SetTexturePalette(SDL_Texture * texture,
   5.213 -                                                  const SDL_Color * colors,
   5.214 -                                                  int firstcolor,
   5.215 -                                                  int ncolors);
   5.216 -
   5.217 -/**
   5.218 - *  \brief Get the color palette from an indexed texture if it has one.
   5.219 - *  
   5.220 - *  \param texture  The texture to update.
   5.221 - *  \param colors     The array to fill with RGB color data.
   5.222 - *  \param firstcolor The first index to retrieve.
   5.223 - *  \param ncolors    The number of palette entries to retrieve.
   5.224 - *  
   5.225 - *  \return 0 on success, or -1 if the texture is not valid or not an indexed 
   5.226 - *          texture.
   5.227 - */
   5.228 -extern DECLSPEC int SDLCALL SDL_GetTexturePalette(SDL_Texture * texture,
   5.229 -                                                  SDL_Color * colors,
   5.230 -                                                  int firstcolor,
   5.231 -                                                  int ncolors);
   5.232 -
   5.233 -/**
   5.234 - *  \brief Set an additional color value used in render copy operations.
   5.235 - *  
   5.236 - *  \param texture The texture to update.
   5.237 - *  \param r       The red color value multiplied into copy operations.
   5.238 - *  \param g       The green color value multiplied into copy operations.
   5.239 - *  \param b       The blue color value multiplied into copy operations.
   5.240 - *  
   5.241 - *  \return 0 on success, or -1 if the texture is not valid or color modulation 
   5.242 - *          is not supported.
   5.243 - *  
   5.244 - *  \sa SDL_GetTextureColorMod()
   5.245 - */
   5.246 -extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture,
   5.247 -                                                   Uint8 r, Uint8 g, Uint8 b);
   5.248 -
   5.249 -
   5.250 -/**
   5.251 - *  \brief Get the additional color value used in render copy operations.
   5.252 - *  
   5.253 - *  \param texture The texture to query.
   5.254 - *  \param r         A pointer filled in with the current red color value.
   5.255 - *  \param g         A pointer filled in with the current green color value.
   5.256 - *  \param b         A pointer filled in with the current blue color value.
   5.257 - *  
   5.258 - *  \return 0 on success, or -1 if the texture is not valid.
   5.259 - *  
   5.260 - *  \sa SDL_SetTextureColorMod()
   5.261 - */
   5.262 -extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture,
   5.263 -                                                   Uint8 * r, Uint8 * g,
   5.264 -                                                   Uint8 * b);
   5.265 -
   5.266 -/**
   5.267 - *  \brief Set an additional alpha value used in render copy operations.
   5.268 - *  
   5.269 - *  \param texture The texture to update.
   5.270 - *  \param alpha     The alpha value multiplied into copy operations.
   5.271 - *  
   5.272 - *  \return 0 on success, or -1 if the texture is not valid or alpha modulation 
   5.273 - *          is not supported.
   5.274 - *  
   5.275 - *  \sa SDL_GetTextureAlphaMod()
   5.276 - */
   5.277 -extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture,
   5.278 -                                                   Uint8 alpha);
   5.279 -
   5.280 -/**
   5.281 - *  \brief Get the additional alpha value used in render copy operations.
   5.282 - *  
   5.283 - *  \param texture The texture to query.
   5.284 - *  \param alpha     A pointer filled in with the current alpha value.
   5.285 - *  
   5.286 - *  \return 0 on success, or -1 if the texture is not valid.
   5.287 - *  
   5.288 - *  \sa SDL_SetTextureAlphaMod()
   5.289 - */
   5.290 -extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture,
   5.291 -                                                   Uint8 * alpha);
   5.292 -
   5.293 -/**
   5.294 - *  \brief Set the blend mode used for texture copy operations.
   5.295 - *  
   5.296 - *  \param texture The texture to update.
   5.297 - *  \param blendMode ::SDL_BlendMode to use for texture blending.
   5.298 - *  
   5.299 - *  \return 0 on success, or -1 if the texture is not valid or the blend mode is
   5.300 - *          not supported.
   5.301 - *  
   5.302 - *  \note If the blend mode is not supported, the closest supported mode is
   5.303 - *        chosen.
   5.304 - *  
   5.305 - *  \sa SDL_GetTextureBlendMode()
   5.306 - */
   5.307 -extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture,
   5.308 -                                                    SDL_BlendMode blendMode);
   5.309 -
   5.310 -/**
   5.311 - *  \brief Get the blend mode used for texture copy operations.
   5.312 - *  
   5.313 - *  \param texture The texture to query.
   5.314 - *  \param blendMode A pointer filled in with the current blend mode.
   5.315 - *  
   5.316 - *  \return 0 on success, or -1 if the texture is not valid.
   5.317 - *  
   5.318 - *  \sa SDL_SetTextureBlendMode()
   5.319 - */
   5.320 -extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture,
   5.321 -                                                    SDL_BlendMode *blendMode);
   5.322 -
   5.323 -/**
   5.324 - *  \brief Update the given texture rectangle with new pixel data.
   5.325 - *  
   5.326 - *  \param texture The texture to update
   5.327 - *  \param rect      A pointer to the rectangle of pixels to update, or NULL to 
   5.328 - *                   update the entire texture.
   5.329 - *  \param pixels    The raw pixel data.
   5.330 - *  \param pitch     The number of bytes between rows of pixel data.
   5.331 - *  
   5.332 - *  \return 0 on success, or -1 if the texture is not valid.
   5.333 - *  
   5.334 - *  \note This is a fairly slow function.
   5.335 - */
   5.336 -extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture,
   5.337 -                                              const SDL_Rect * rect,
   5.338 -                                              const void *pixels, int pitch);
   5.339 -
   5.340 -/**
   5.341 - *  \brief Lock a portion of the texture for pixel access.
   5.342 - *  
   5.343 - *  \param texture The texture to lock for access, which was created with 
   5.344 - *                   ::SDL_TEXTUREACCESS_STREAMING.
   5.345 - *  \param rect      A pointer to the rectangle to lock for access. If the rect 
   5.346 - *                   is NULL, the entire texture will be locked.
   5.347 - *  \param markDirty If this is nonzero, the locked area will be marked dirty 
   5.348 - *                   when the texture is unlocked.
   5.349 - *  \param pixels    This is filled in with a pointer to the locked pixels, 
   5.350 - *                   appropriately offset by the locked area.
   5.351 - *  \param pitch     This is filled in with the pitch of the locked pixels.
   5.352 - *  
   5.353 - *  \return 0 on success, or -1 if the texture is not valid or was created with 
   5.354 - *          ::SDL_TEXTUREACCESS_STATIC.
   5.355 - *  
   5.356 - *  \sa SDL_DirtyTexture()
   5.357 - *  \sa SDL_UnlockTexture()
   5.358 - */
   5.359 -extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture,
   5.360 -                                            const SDL_Rect * rect,
   5.361 -                                            int markDirty, void **pixels,
   5.362 -                                            int *pitch);
   5.363 -
   5.364 -/**
   5.365 - *  \brief Unlock a texture, uploading the changes to video memory, if needed.
   5.366 - *  
   5.367 - *  \sa SDL_LockTexture()
   5.368 - *  \sa SDL_DirtyTexture()
   5.369 - */
   5.370 -extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture);
   5.371 -
   5.372 -/**
   5.373 - *  \brief Mark the specified rectangles of the texture as dirty.
   5.374 - *  
   5.375 - *  \param texture The texture to mark dirty, which was created with 
   5.376 - *                   ::SDL_TEXTUREACCESS_STREAMING.
   5.377 - *  \param numrects  The number of rectangles pointed to by rects.
   5.378 - *  \param rects     The pointer to an array of dirty rectangles.
   5.379 - *  
   5.380 - *  \sa SDL_LockTexture()
   5.381 - *  \sa SDL_UnlockTexture()
   5.382 - */
   5.383 -extern DECLSPEC void SDLCALL SDL_DirtyTexture(SDL_Texture * texture,
   5.384 -                                              int numrects,
   5.385 -                                              const SDL_Rect * rects);
   5.386 -
   5.387 -/**
   5.388 - *  \brief Set the color used for drawing operations (Fill and Line).
   5.389 - *  
   5.390 - *  \param r The red value used to draw on the rendering target.
   5.391 - *  \param g The green value used to draw on the rendering target.
   5.392 - *  \param b The blue value used to draw on the rendering target.
   5.393 - *  \param a The alpha value used to draw on the rendering target, usually 
   5.394 - *           ::SDL_ALPHA_OPAQUE (255).
   5.395 - *  
   5.396 - *  \return 0 on success, or -1 if there is no rendering context current.
   5.397 - */
   5.398 -extern DECLSPEC int SDL_SetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b,
   5.399 -                                           Uint8 a);
   5.400 -
   5.401 -/**
   5.402 - *  \brief Get the color used for drawing operations (Fill and Line).
   5.403 - *  
   5.404 - *  \param r A pointer to the red value used to draw on the rendering target.
   5.405 - *  \param g A pointer to the green value used to draw on the rendering target.
   5.406 - *  \param b A pointer to the blue value used to draw on the rendering target.
   5.407 - *  \param a A pointer to the alpha value used to draw on the rendering target, 
   5.408 - *           usually ::SDL_ALPHA_OPAQUE (255).
   5.409 - *  
   5.410 - *  \return 0 on success, or -1 if there is no rendering context current.
   5.411 - */
   5.412 -extern DECLSPEC int SDL_GetRenderDrawColor(Uint8 * r, Uint8 * g, Uint8 * b,
   5.413 -                                           Uint8 * a);
   5.414 -
   5.415 -/**
   5.416 - *  \brief Set the blend mode used for drawing operations (Fill and Line).
   5.417 - *  
   5.418 - *  \param blendMode ::SDL_BlendMode to use for blending.
   5.419 - *  
   5.420 - *  \return 0 on success, or -1 if there is no rendering context current.
   5.421 - *  
   5.422 - *  \note If the blend mode is not supported, the closest supported mode is 
   5.423 - *        chosen.
   5.424 - *  
   5.425 - *  \sa SDL_GetRenderDrawBlendMode()
   5.426 - */
   5.427 -extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_BlendMode blendMode);
   5.428 -
   5.429 -/**
   5.430 - *  \brief Get the blend mode used for drawing operations.
   5.431 - *  
   5.432 - *  \param blendMode A pointer filled in with the current blend mode.
   5.433 - *  
   5.434 - *  \return 0 on success, or -1 if there is no rendering context current.
   5.435 - *  
   5.436 - *  \sa SDL_SetRenderDrawBlendMode()
   5.437 - */
   5.438 -extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_BlendMode *blendMode);
   5.439 -
   5.440 -/**
   5.441 - *  \brief Clear the current rendering target with the drawing color
   5.442 - */
   5.443 -extern DECLSPEC int SDLCALL SDL_RenderClear(void);
   5.444 -
   5.445 -/**
   5.446 - *  \brief Draw a point on the current rendering target.
   5.447 - *  
   5.448 - *  \param x The x coordinate of the point.
   5.449 - *  \param y The y coordinate of the point.
   5.450 - *  
   5.451 - *  \return 0 on success, or -1 if there is no rendering context current.
   5.452 - */
   5.453 -extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(int x, int y);
   5.454 -
   5.455 -/**
   5.456 - *  \brief Draw multiple points on the current rendering target.
   5.457 - *  
   5.458 - *  \param points The points to draw
   5.459 - *  \param count The number of points to draw
   5.460 - *  
   5.461 - *  \return 0 on success, or -1 if there is no rendering context current.
   5.462 - */
   5.463 -extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(const SDL_Point * points,
   5.464 -                                                 int count);
   5.465 -
   5.466 -/**
   5.467 - *  \brief Draw a line on the current rendering target.
   5.468 - *  
   5.469 - *  \param x1 The x coordinate of the start point.
   5.470 - *  \param y1 The y coordinate of the start point.
   5.471 - *  \param x2 The x coordinate of the end point.
   5.472 - *  \param y2 The y coordinate of the end point.
   5.473 - *  
   5.474 - *  \return 0 on success, or -1 if there is no rendering context current.
   5.475 - */
   5.476 -extern DECLSPEC int SDLCALL SDL_RenderDrawLine(int x1, int y1, int x2, int y2);
   5.477 -
   5.478 -/**
   5.479 - *  \brief Draw a series of connected lines on the current rendering target.
   5.480 - *  
   5.481 - *  \param points The points along the lines
   5.482 - *  \param count The number of points, drawing count-1 lines
   5.483 - *  
   5.484 - *  \return 0 on success, or -1 if there is no rendering context current.
   5.485 - */
   5.486 -extern DECLSPEC int SDLCALL SDL_RenderDrawLines(const SDL_Point * points,
   5.487 -                                                int count);
   5.488 -
   5.489 -/**
   5.490 - *  \brief Draw a rectangle on the current rendering target.
   5.491 - *  
   5.492 - *  \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
   5.493 - *  
   5.494 - *  \return 0 on success, or -1 if there is no rendering context current.
   5.495 - */
   5.496 -extern DECLSPEC int SDLCALL SDL_RenderDrawRect(const SDL_Rect * rect);
   5.497 -
   5.498 -/**
   5.499 - *  \brief Draw some number of rectangles on the current rendering target.
   5.500 - *  
   5.501 - *  \param rects A pointer to an array of destination rectangles.
   5.502 - *  \param count The number of rectangles.
   5.503 - *  
   5.504 - *  \return 0 on success, or -1 if there is no rendering context current.
   5.505 - */
   5.506 -extern DECLSPEC int SDLCALL SDL_RenderDrawRects(const SDL_Rect ** rects, int count);
   5.507 -
   5.508 -/**
   5.509 - *  \brief Fill a rectangle on the current rendering target with the drawing color.
   5.510 - *  
   5.511 - *  \param rect A pointer to the destination rectangle, or NULL for the entire 
   5.512 - *              rendering target.
   5.513 - *  
   5.514 - *  \return 0 on success, or -1 if there is no rendering context current.
   5.515 - */
   5.516 -extern DECLSPEC int SDLCALL SDL_RenderFillRect(const SDL_Rect * rect);
   5.517 -
   5.518 -/**
   5.519 - *  \brief Fill some number of rectangles on the current rendering target with the drawing color.
   5.520 - *  
   5.521 - *  \param rects A pointer to an array of destination rectangles.
   5.522 - *  \param count The number of rectangles.
   5.523 - *  
   5.524 - *  \return 0 on success, or -1 if there is no rendering context current.
   5.525 - */
   5.526 -extern DECLSPEC int SDLCALL SDL_RenderFillRects(const SDL_Rect ** rect, int count);
   5.527 -
   5.528 -/**
   5.529 - *  \brief Copy a portion of the texture to the current rendering target.
   5.530 - *  
   5.531 - *  \param texture The source texture.
   5.532 - *  \param srcrect   A pointer to the source rectangle, or NULL for the entire 
   5.533 - *                   texture.
   5.534 - *  \param dstrect   A pointer to the destination rectangle, or NULL for the 
   5.535 - *                   entire rendering target.
   5.536 - *  
   5.537 - *  \return 0 on success, or -1 if there is no rendering context current, or the
   5.538 - *          driver doesn't support the requested operation.
   5.539 - */
   5.540 -extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Texture * texture,
   5.541 -                                           const SDL_Rect * srcrect,
   5.542 -                                           const SDL_Rect * dstrect);
   5.543 -
   5.544 -/**
   5.545 - *  \brief Read pixels from the current rendering target.
   5.546 - *  
   5.547 - *  \param rect   A pointer to the rectangle to read, or NULL for the entire 
   5.548 - *                render target.
   5.549 - *  \param format The desired format of the pixel data, or 0 to use the format
   5.550 - *                of the rendering target
   5.551 - *  \param pixels A pointer to be filled in with the pixel data
   5.552 - *  \param pitch  The pitch of the pixels parameter.
   5.553 - *  
   5.554 - *  \return 0 on success, or -1 if pixel reading is not supported.
   5.555 - *  
   5.556 - *  \warning This is a very slow operation, and should not be used frequently.
   5.557 - */
   5.558 -extern DECLSPEC int SDLCALL SDL_RenderReadPixels(const SDL_Rect * rect,
   5.559 -                                                 Uint32 format,
   5.560 -                                                 void *pixels, int pitch);
   5.561 -
   5.562 -/**
   5.563 - *  \brief Write pixels to the current rendering target.
   5.564 - *  
   5.565 - *  \param rect   A pointer to the rectangle to write, or NULL for the entire 
   5.566 - *                render target.
   5.567 - *  \param format The format of the pixel data, or 0 to use the format
   5.568 - *                of the rendering target
   5.569 - *  \param pixels A pointer to the pixel data to write.
   5.570 - *  \param pitch  The pitch of the pixels parameter.
   5.571 - *  
   5.572 - *  \return 0 on success, or -1 if pixel writing is not supported.
   5.573 - *  
   5.574 - *  \warning This is a very slow operation, and should not be used frequently.
   5.575 - */
   5.576 -extern DECLSPEC int SDLCALL SDL_RenderWritePixels(const SDL_Rect * rect,
   5.577 -                                                  Uint32 format,
   5.578 -                                                  const void *pixels,
   5.579 -                                                  int pitch);
   5.580 -
   5.581 -/**
   5.582 - *  \brief Update the screen with rendering performed.
   5.583 - */
   5.584 -extern DECLSPEC void SDLCALL SDL_RenderPresent(void);
   5.585 -
   5.586 -/**
   5.587 - *  \brief Destroy the specified texture.
   5.588 - *  
   5.589 - *  \sa SDL_CreateTexture()
   5.590 - *  \sa SDL_CreateTextureFromSurface()
   5.591 - */
   5.592 -extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture);
   5.593 -
   5.594 -/**
   5.595 - *  \brief Destroy the rendering context for a window and free associated
   5.596 - *         textures.
   5.597 - *  
   5.598 - *  \sa SDL_CreateRenderer()
   5.599 - */
   5.600 -extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Window * window);
   5.601  
   5.602  /**
   5.603   *  \brief Returns whether the screensaver is currently enabled (default on).
     6.1 --- a/src/video/SDL_sysvideo.h	Tue Feb 01 12:54:27 2011 -0800
     6.2 +++ b/src/video/SDL_sysvideo.h	Tue Feb 01 15:02:21 2011 -0800
     6.3 @@ -26,6 +26,7 @@
     6.4  
     6.5  #include "SDL_mouse.h"
     6.6  #include "SDL_keysym.h"
     6.7 +#include "SDL_render.h"
     6.8  #include "SDL_shape.h"
     6.9  
    6.10  /* The SDL video driver */