Function TCOD_renderer_init_sdl2

Function Documentation

struct TCOD_Context *TCOD_renderer_init_sdl2(int x, int y, int width, int height, const char *title, int window_flags, int vsync, struct TCOD_Tileset *tileset)

Return a libtcod rendering context using an SDL renderer.

Despite the name this returns a context for SDL3.

Parameters:
  • x – Window X position, if unsure then use SDL_WINDOWPOS_UNDEFINED

  • y – Window Y position, if unsure then use SDL_WINDOWPOS_UNDEFINED

  • width – Window width in pixels

  • height – Window height in pixels

  • title – Window title text

  • window_flags – SDL window flags, see SDL_WindowFlags

  • vsync – Enables VSync

  • tileset – The tileset to use for this context.

Returns:

The new context, will need to deleted with TCOD_context_delete when you are done with it.