Function TCOD_sdl2_render_texture¶
Defined in File renderer_sdl2.h
Function Documentation¶
-
TCOD_Error TCOD_sdl2_render_texture(const struct TCOD_TilesetAtlasSDL2 *atlas, const struct TCOD_Console *console, struct TCOD_Console *cache, struct SDL_Texture *target)¶
Render a console onto a managed target texture.
This function assumes that
cacheandtargetare valid. You can useTCOD_sdl2_render_texture_setupto automatically prepare these objects for use with this function.atlasis an SDL2 atlas created withTCOD_sdl2_atlas_new. The renderer used to make thisatlasmust supportSDL_RENDERER_TARGETTEXTURE, unlesstargetis NULL.consoleis a non-NULL pointer to the libtcod console you want to render.cachecan be NULL, or point to a console the same size asconsole.targetcan be NULL, or be pointer an SDL2 texture used as the output. Iftargetis not NULL then it should be the size of the console times the size of the individual tiles to fit the entire output.If
targetis NULL then the current render target is used instead, the drawn area will not be scaled to fit the render target.If SDL2 ever provides a
SDL_RENDER_TARGETS_RESETevent then the console atcachemust be cleared, or else the next render will only partially update the texture oftarget.Returns a negative value on an error, check
TCOD_get_error.Added in version 1.16.