libtcod
Loading...
Searching...
No Matches
TCOD_ContextParams Struct Reference

A struct of parameters used to create a new context with TCOD_context_new. More...

#include <context.h>

Public Attributes

int tcod_version
 Compiled libtcod version for ABI compatiblity with older versions of libtcod.
int window_x
 window_x and window_y are the starting position of the window.
int window_y
int pixel_width
 pixel_width and pixel_height are the desired size of the window in pixels.
int pixel_height
int columns
 columns and rows are the desired size of the terminal window.
int rows
int renderer_type
 renderer_type is one of the TCOD_renderer_t values.
TCOD_Tilesettileset
 tileset is an optional pointer to a tileset object.
int vsync
 If vsync is true, then vertical sync will be enabled whenever possible.
int sdl_window_flags
 sdl_window_flags is a bitfield of SDL_WindowFlags flags.
const char * window_title
 window_title will be the title of the opened window.
int argc
 The number of items in argv.
const char *const * argv
 argc and argv are optional CLI parameters.
void(* cli_output )(void *userdata, const char *output)
 If user attention is required for the given CLI parameters then cli_output will be called with cli_userdata and an error or help message.
void * cli_userdata
 This is passed to the userdata parameter of cli_output if called.
bool window_xy_defined
 If this is false then window_x/window_y parameters of zero are assumed to be undefined and will be changed to SDL_WINDOWPOS_UNDEFINED.
TCOD_Consoleconsole
 A console to be used as a reference for the desired window size.

Detailed Description

A struct of parameters used to create a new context with TCOD_context_new.

embed:rst:leading-asterisk 
.. versionadded:: 1.19

Member Data Documentation

◆ argv

const char* const* TCOD_ContextParams::argv

argc and argv are optional CLI parameters.

You can pass 0 and NULL respectfully to ignore them. If unsure then you should pass the argc and argv arguments from your main function.

◆ cli_output

void(* TCOD_ContextParams::cli_output) (void *userdata, const char *output)

If user attention is required for the given CLI parameters then cli_output will be called with cli_userdata and an error or help message.

If cli_output is NULL then it will print the message to stdout and terminate the program. If cli_output returns normally then TCOD_E_REQUIRES_ATTENTION will be returned from TCOD_context_new.

◆ columns

int TCOD_ContextParams::columns

columns and rows are the desired size of the terminal window.

Usually you'll set either these or the pixel resolution.

If you are setting these values from a TCOD_Console then you should set the console attribute instead.

◆ console

TCOD_Console* TCOD_ContextParams::console

A console to be used as a reference for the desired window size.

This can set as an alternative to the columns and rows attributes.

embed:rst:leading-asterisk 
.. versionadded:: 1.19

◆ pixel_width

int TCOD_ContextParams::pixel_width

pixel_width and pixel_height are the desired size of the window in pixels.

If these are zero then they'll be derived from columns, rows, and the tileset.

◆ sdl_window_flags

int TCOD_ContextParams::sdl_window_flags

sdl_window_flags is a bitfield of SDL_WindowFlags flags.

For a window, a value of SDL_WINDOW_RESIZABLE is recommended. For fullscreen, a value of SDL_WINDOW_RESIZABLE | SDL_WINDOW_FULLSCREEN_DESKTOP is recommended. You should avoid the SDL_WINDOW_FULLSCREEN flag whenever possible.

◆ tcod_version

int TCOD_ContextParams::tcod_version

Compiled libtcod version for ABI compatiblity with older versions of libtcod.

Deprecated
Deprecated since 2.0. You must no longer assign anything to this.

◆ tileset

TCOD_Tileset* TCOD_ContextParams::tileset

tileset is an optional pointer to a tileset object.

If this is NULL then a platform specific fallback tileset will be used. This fallback is known to be unreliable, but it should work well enough for prototyping code.

◆ vsync

int TCOD_ContextParams::vsync

If vsync is true, then vertical sync will be enabled whenever possible.

A value of true is recommended.

◆ window_title

const char* TCOD_ContextParams::window_title

window_title will be the title of the opened window.

If not set then argv[0] will be used if available.

◆ window_x

int TCOD_ContextParams::window_x

window_x and window_y are the starting position of the window.

These are SDL parameters so values like SDL_WINDOWPOS_UNDEFINED and SDL_WINDOWPOS_CENTERED are acceptable.

Values of zero will be converted to SDL_WINDOWPOS_UNDEFINED unless window_xy_defined is true.


The documentation for this struct was generated from the following file:
  • C:/Users/4b796/Projects/libtcod/src/libtcod/context.h