diff include/SDL_render.h @ 5159:307ccc9c135e

Made it possible to create a texture of any format, even if not supported by the renderer. This allows me to reduce the set of formats supported by the renderers to the most optimal set, for a nice speed boost.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 03 Feb 2011 00:19:40 -0800
parents be02be2ea897
children 657543cc92f9
line wrap: on
line diff
--- a/include/SDL_render.h	Wed Feb 02 22:55:12 2011 -0800
+++ b/include/SDL_render.h	Thu Feb 03 00:19:40 2011 -0800
@@ -61,7 +61,7 @@
     const char *name;           /**< The name of the renderer */
     Uint32 flags;               /**< Supported ::SDL_RendererFlags */
     Uint32 num_texture_formats; /**< The number of available texture formats */
-    Uint32 texture_formats[50]; /**< The available texture formats */
+    Uint32 texture_formats[16]; /**< The available texture formats */
     int max_texture_width;      /**< The maximimum texture width */
     int max_texture_height;     /**< The maximimum texture height */
 } SDL_RendererInfo;
@@ -204,22 +204,6 @@
                                              int *w, int *h);
 
 /**
- *  \brief Query the pixels of a texture, if the texture does not need to be 
- *         locked for pixel access.
- *  
- *  \param texture A texture to be queried, which was created with 
- *                   ::SDL_TEXTUREACCESS_STREAMING.
- *  \param pixels    A pointer filled with a pointer to the pixels for the 
- *                   texture.
- *  \param pitch     A pointer filled in with the pitch of the pixel data.
- *  
- *  \return 0 on success, or -1 if the texture is not valid, or must be locked 
- *          for pixel access.
- */
-extern DECLSPEC int SDLCALL SDL_QueryTexturePixels(SDL_Texture * texture,
-                                                   void **pixels, int *pitch);
-
-/**
  *  \brief Set an additional color value used in render copy operations.
  *  
  *  \param texture The texture to update.
@@ -299,7 +283,7 @@
 /**
  *  \brief Get the blend mode used for texture copy operations.
  *  
- *  \param texture The texture to query.
+ *  \param texture   The texture to query.
  *  \param blendMode A pointer filled in with the current blend mode.
  *  
  *  \return 0 on success, or -1 if the texture is not valid.
@@ -312,7 +296,7 @@
 /**
  *  \brief Update the given texture rectangle with new pixel data.
  *  
- *  \param texture The texture to update
+ *  \param texture   The texture to update
  *  \param rect      A pointer to the rectangle of pixels to update, or NULL to 
  *                   update the entire texture.
  *  \param pixels    The raw pixel data.
@@ -329,49 +313,28 @@
 /**
  *  \brief Lock a portion of the texture for pixel access.
  *  
- *  \param texture The texture to lock for access, which was created with 
+ *  \param texture   The texture to lock for access, which was created with 
  *                   ::SDL_TEXTUREACCESS_STREAMING.
  *  \param rect      A pointer to the rectangle to lock for access. If the rect 
  *                   is NULL, the entire texture will be locked.
- *  \param markDirty If this is nonzero, the locked area will be marked dirty 
- *                   when the texture is unlocked.
  *  \param pixels    This is filled in with a pointer to the locked pixels, 
  *                   appropriately offset by the locked area.
  *  \param pitch     This is filled in with the pitch of the locked pixels.
  *  
- *  \return 0 on success, or -1 if the texture is not valid or was created with 
- *          ::SDL_TEXTUREACCESS_STATIC.
+ *  \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING.
  *  
- *  \sa SDL_DirtyTexture()
  *  \sa SDL_UnlockTexture()
  */
 extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture,
                                             const SDL_Rect * rect,
-                                            int markDirty, void **pixels,
-                                            int *pitch);
-
-/**
- *  \brief Unlock a texture, uploading the changes to renderer memory, if needed.
- *  
- *  \sa SDL_LockTexture()
- *  \sa SDL_DirtyTexture()
- */
-extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture);
+                                            void **pixels, int *pitch);
 
 /**
- *  \brief Mark the specified rectangles of the texture as dirty.
- *  
- *  \param texture The texture to mark dirty, which was created with 
- *                   ::SDL_TEXTUREACCESS_STREAMING.
- *  \param numrects  The number of rectangles pointed to by rects.
- *  \param rects     The pointer to an array of dirty rectangles.
+ *  \brief Unlock a texture, uploading the changes to video memory, if needed.
  *  
  *  \sa SDL_LockTexture()
- *  \sa SDL_UnlockTexture()
  */
-extern DECLSPEC void SDLCALL SDL_DirtyTexture(SDL_Texture * texture,
-                                              int numrects,
-                                              const SDL_Rect * rects);
+extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture);
 
 /**
  *  \brief Set the color used for drawing operations (Fill and Line).