Implementation of render targets, by Mason Wheeler and Gabriel Jacobo

Thanks guys!
This commit is contained in:
Sam Lantinga 2012-01-18 22:45:49 -05:00
parent 2e70e7f3cb
commit a49a88676f
11 changed files with 879 additions and 45 deletions

View file

@ -88,7 +88,8 @@ typedef struct SDL_RendererInfo
typedef enum
{
SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */
SDL_TEXTUREACCESS_STREAMING /**< Changes frequently, lockable */
SDL_TEXTUREACCESS_STREAMING, /**< Changes frequently, lockable */
SDL_TEXTUREACCESS_TARGET /**< Texture can be used as a render target */
} SDL_TextureAccess;
/**
@ -561,6 +562,31 @@ extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer,
const SDL_Rect * srcrect,
const SDL_Rect * dstrect);
/**
* \fn SDL_bool SDL_RenderTargetSupported(SDL_Renderer *renderer)
*
* \brief Determines whether a window supports the use of render targets
*
* \param renderer The renderer that will be checked
*
* \return SDL_TRUE if supported, SDL_FALSE if not.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer);
/**
* \fn int SDL_SetTargetTexture(SDL_Renderer *renderer, SDL_Texture *texture)
*
* \brief Set a texture as the current rendering target.
*
* \param renderer The renderer that will be checked
*
* \param texture The targeted texture, or NULL for the default render target
*
* \return 0 on success, or -1 if there is no rendering context current, or the driver doesn't support the requested operation.
*/
extern DECLSPEC int SDLCALL SDL_SetTargetTexture(SDL_Renderer *renderer, SDL_Texture *texture);
/**
* \brief Read pixels from the current rendering target.
*