|
libtcod
|
Deprecated root console initialization. More...
#include "config.h"#include "console.h"#include "console_types.h"#include "context.h"#include "error.h"#include "tileset.h"Go to the source code of this file.
Namespaces | |
| namespace | tcod |
| The libtcod namespace. | |
Functions | |
| TCOD_Error | TCOD_console_init_root (int w, int h, const char *title, bool fullscreen, TCOD_renderer_t renderer) |
| Initialize the libtcod graphical engine. | |
| void | TCOD_console_set_window_title (const char *title) |
| Change the title string of the active window. | |
| void | TCOD_console_set_fullscreen (bool fullscreen) |
| Set the display to be full-screen or windowed. | |
| bool | TCOD_console_is_fullscreen (void) |
| Return true if the display is full-screen. | |
| bool | TCOD_console_has_mouse_focus (void) |
| Return true if the window has mouse focus. | |
| bool | TCOD_console_is_active (void) |
| Return true if the window has keyboard focus. | |
| bool | TCOD_console_is_window_closed (void) |
| Return true if the window is closing. | |
| struct SDL_Window * | TCOD_sys_get_sdl_window (void) |
| Return an SDL_Window pointer if one is in use, returns NULL otherwise. | |
| struct SDL_Renderer * | TCOD_sys_get_sdl_renderer (void) |
| Return an SDL_Renderer pointer if one is in use, returns NULL otherwise. | |
| int | TCOD_sys_accumulate_console (const TCOD_Console *console) |
| Render a console over the display. | |
| TCOD_Context * | TCOD_sys_get_internal_context (void) |
| Return the context being used internally by the old API. | |
| TCOD_Console * | TCOD_sys_get_internal_console (void) |
| Return a pointer to the "root console" used internally by the old API. | |
| void | TCOD_quit (void) |
| Shutdown libtcod. | |
| void | tcod::console::init_root (int w, int h, const std::string &title, bool fullscreen, TCOD_renderer_t renderer) |
| void | tcod::console::init_root (int w, int h, const std::string &title, bool fullscreen, TCOD_renderer_t renderer, bool vsync) |
Deprecated root console initialization.
| TCOD_Error TCOD_console_init_root | ( | int | w, |
| int | h, | ||
| const char * | title, | ||
| bool | fullscreen, | ||
| TCOD_renderer_t | renderer ) |
Initialize the libtcod graphical engine.
| 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. |
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 the TCOD_RENDERER or TCOD_VSYNC environment variables.
Valid case-sensitive options for TCOD_RENDERER are:
Valid options for TCOD_VSYNC are 0 or 1.
embed:rst:leading-asterisk * .. versionchanged:: 1.12 * Now returns -1 on error instead of crashing. * * .. versionchanged:: 1.13 * Added the `TCOD_RENDERER` and `TCOD_VSYNC` overrides. *
| bool TCOD_console_is_active | ( | void | ) |
Return true if the window has keyboard focus.
embed:rst:leading-asterisk * .. versionchanged: 1.7 * This function was previously broken. It now keeps track of keyboard * focus. *
| void TCOD_console_set_fullscreen | ( | bool | fullscreen | ) |
Set the display to be full-screen or windowed.
| fullscreen | If true the display will go full-screen. |
| void TCOD_console_set_window_title | ( | const char * | title | ) |
Change the title string of the active window.
| title | A utf8 string. |
| void TCOD_quit | ( | void | ) |
Shutdown libtcod.
This must be called before your program exits.
embed:rst:leading-asterisk .. versionadded:: 1.8
| int TCOD_sys_accumulate_console | ( | const TCOD_Console * | console | ) |
Render a console over the display.
embed:rst:leading-asterisk * `console` can be any size, the active render will try to scale it to fit * the screen. * * The function will only work for the SDL2/OPENGL2 renderers. * * Unlike TCOD_console_flush this will not present the display. * You will need to do that manually, likely with the SDL API. * * Returns 0 on success, or a negative number on a failure such as the * incorrect renderer being active. * * .. versionadded:: 1.11 * * .. seealso:: * TCOD_sys_get_sdl_window TCOD_sys_get_sdl_renderer *
| TCOD_Console * TCOD_sys_get_internal_console | ( | void | ) |
Return a pointer to the "root console" used internally by the old API.
This is useful for functions which take a console parameter but won't accept NULL.
embed:rst:leading-asterisk .. versionadded:: 1.19
| TCOD_Context * TCOD_sys_get_internal_context | ( | void | ) |
Return the context being used internally by the old API.
This function can be useful to progressively upgrade older code to use the newer API.
embed:rst:leading-asterisk .. versionadded:: 1.19
| struct SDL_Renderer * TCOD_sys_get_sdl_renderer | ( | void | ) |
Return an SDL_Renderer pointer if one is in use, returns NULL otherwise.
embed:rst:leading-asterisk * .. versionadded:: 1.11 *
| struct SDL_Window * TCOD_sys_get_sdl_window | ( | void | ) |
Return an SDL_Window pointer if one is in use, returns NULL otherwise.
embed:rst:leading-asterisk * .. versionadded:: 1.11 *