Use this function to set a texture as the current rendering target.
int SDL_SetRenderTarget(SDL_Renderer* renderer, SDL_Texture* texture)
the rendering context
the targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target
Returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.
You can add your code example here
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.
This function is available since SDL 2.0.0.