Function TCOD_console_init_root¶
Defined in File console_init.h
Function Documentation¶
-
TCOD_Error TCOD_console_init_root(int w, int h, const char *title, bool fullscreen, TCOD_renderer_t renderer)
Initialize the libtcod graphical engine.
You may want to call TCOD_console_set_custom_font BEFORE calling this function. By default this function loads libtcod’s
terminal.png
image from the working directory.Afterwards TCOD_quit must be called before the program exits.
Returns 0 on success, or -1 on an error, you can check the error with TCOD_sys_get_error()
renderer
and vsync settings can be overridden by theTCOD_RENDERER
orTCOD_VSYNC
environment variables.Valid case-sensitive options for
TCOD_RENDERER
are:sdl
opengl
glsl
sdl2
opengl2
Valid options for
TCOD_VSYNC
are0
or1
.Changed in version 1.12: Now returns -1 on error instead of crashing.
Changed in version 1.13: Added the TCOD_RENDERER and TCOD_VSYNC overrides.
- Parameters:
w – The width in tiles.
h – The height in tiles.
title – The title for the window.
fullscreen – Fullscreen option.
renderer – Which renderer to use when rendering the console.