Wiki Page Content

Differences between revisions 10 and 11
Revision 10 as of 2016-05-11 20:36:11
Size: 1201
Comment: Added SDL_GetRenderTarget to Related functions, see SGFunctions.
Revision 11 as of 2016-05-11 20:37:00
Size: 1179
Comment: Removed SDL_RenderCopy from Related functions.
Deletions are marked like this. Additions are marked like this.
Line 38: Line 38:
 .[[SDL_RenderCopy]]

SDL_SetRenderTarget

Use this function to set a texture as the current rendering target.

Syntax

int SDL_SetRenderTarget(SDL_Renderer* renderer,
                        SDL_Texture*  texture)

Function Parameters

renderer

the rendering context

texture

the targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target

Return Value

Returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.

Code Examples

You can add your code example here

Remarks

Before using this function, you should check the SDL_RENDERER_TARGETTEXTURE bit in the flags of SDL_RendererInfo to see if render targets are supported.

The default render target is the window for which the renderer was created.

Version

This function is available since SDL 2.0.0.


CategoryAPI, CategoryRender

None: SDL_SetRenderTarget (last edited 2016-05-11 20:37:00 by PhilippWiesemann)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit