< index
< 2. Console emulator
< 2.1 Initializing the console

=====================================
2.1.1 Creating the game window
=====================================

C++ : static void TCODConsole::initRoot(int w, int h, const char * title, bool fullscreen = false)
C   : void TCOD_console_init_root(int w, int h, const char * title, bool fullscreen)
Py  : console_init_root(w,h,title,fullscreen)

This will either create a new window in your desktop or switch to full screen. Once this function has been called, you access the root console in C++ with TCODConsole::root, in C by using a NULL console handler.
Note that the C header (libtcod.h) defines the bool type for the C language with :

  typedef enum { false, true } bool;

ParameterDescription
w, hsize of the console(in characters). The default characters size in libtcod is 8x8. Here are the resulting resolutions :
wxhconsole size in pixels
80x50640x400
80x60640x480
100x75800x600
128x961024x768
144x1081152x864
160x1281280x1024
titletitle of the window. It's not visible when you are in fullscreen.
fullscreenwether you start in windowed or fullscreen mode.
Example :

C++ : TCODConsole::initRoot(80,50,"The Chronicles Of Doryen v0.1",false);
C   : TCOD_console_init_root(80,50,"The Chronicles Of Doryen v0.1",false);
Py  : libtcod.console_init_root(80,50,"The Chronicles Of Doryen v0.1",False)

insert a comment