2.1.4. Fullscreen mode
Getting the current mode
This function returns true if the current mode is fullscreen.
static bool TCODConsole::isFullscreen()
bool TCOD_console_is_fullscreen()
console_is_fullscreen()
Switching between windowed and fullscreen modes
This function switches the root console to fullscreen or windowed mode.
Note that there is no predefined key combination to switch to/from fullscreen. You have to do this in your own code.
static void TCODConsole::setFullscreen(bool fullscreen)
void TCOD_console_set_fullscreen(bool fullscreen)
console_set_fullscreen(fullscreen)
Parameter | Description |
---|---|
fullscreen | true to switch to fullscreen mode. false to switch to windowed mode. |
Example:
TCOD_key_t key;
TCODConsole::checkForEvent(TCOD_EVENT_KEY_PRESS,&key,NULL);
if ( key.vk == TCODK_ENTER && key.lalt )
TCODConsole::setFullscreen(!TCODConsole::isFullscreen());
TCOD_key_t key;
TCOD_console_check_for_event(TCOD_EVENT_KEY_PRESS,&key,NULL);
if ( key.vk == TCODK_ENTER && key.lalt )
TCOD_console_set_fullscreen(!TCOD_console_is_fullscreen());
key=Key()
libtcod.console_check_for_event(libtcod.EVENT_KEY_PRESS,key,0)
if key.vk == libtcod.KEY_ENTER and key.lalt :
libtcod.console_set_fullscreen(not libtcod.console_is_fullscreen())