diff options
author | Sam Lantinga <slouken@libsdl.org> | 2012-01-18 22:45:49 -0500 |
---|---|---|
committer | Sam Lantinga <slouken@libsdl.org> | 2012-01-18 22:45:49 -0500 |
commit | 3d67226719567d73c0d6317e3ad2cb7d4b6c92ec (patch) | |
tree | 960101861679a576ab72308966fa9a4adf8c70c6 /include | |
parent | 4b4cbe0d115e7d39ef5dd87cdf4b312ae31ae9ff (diff) |
Implementation of render targets, by Mason Wheeler and Gabriel Jacobo
Thanks guys!
Diffstat (limited to 'include')
-rw-r--r-- | include/SDL_render.h | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/include/SDL_render.h b/include/SDL_render.h index a8052076..51b641b6 100644 --- a/include/SDL_render.h +++ b/include/SDL_render.h @@ -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. * |