Struct TCOD_ContextParams¶
Defined in File context.h
Struct Documentation¶
-
struct TCOD_ContextParams
A struct of parameters used to create a new context with
TCOD_context_new
.New in version 1.19.
Public Members
-
int tcod_version
Must be
TCOD_COMPILEDVERSION
.
-
int window_x
window_x
andwindow_y
are the starting position of the window.These are SDL parameters so values like
SDL_WINDOWPOS_UNDEFINED
andSDL_WINDOWPOS_CENTERED
are acceptable.Values of zero will be converted to
SDL_WINDOWPOS_UNDEFINED
unlesswindow_xy_defined
is true.
-
int window_y
-
int pixel_width
pixel_width
andpixel_height
are the desired size of the window in pixels.If these are zero then they’ll be derived from
columns
,rows
, and thetileset
.
-
int pixel_height
-
int columns
columns
androws
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.
-
int rows
-
int renderer_type
renderer_type
is one of theTCOD_renderer_t
values.
-
TCOD_Tileset *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.
-
int vsync
If
vsync
is true, then vertical sync will be enabled whenever possible.A value of true is recommended.
-
int 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 ofSDL_WINDOW_RESIZABLE | SDL_WINDOW_FULLSCREEN_DESKTOP
is recommended. You should avoid theSDL_WINDOW_FULLSCREEN
flag whenever possible.
-
const char *window_title
window_title
will be the title of the opened window.If not set then
argv[0]
will be used if available.
-
int argc
The number of items in
argv
.
-
const char *const *argv
argc
andargv
are optional CLI parameters.You can pass
0
andNULL
respectfully to ignore them. If unsure then you should pass theargc
andargv
arguments from yourmain
function.
-
void (*cli_output)(void *userdata, const char *output)
If user attention is required for the given CLI parameters then
cli_output
will be called withcli_userdata
and an error or help message.If
cli_output
is NULL then it will print the message to stdout and terminate the program. Ifcli_output
returns normally then TCOD_E_REQUIRES_ATTENTION will be returned fromTCOD_context_new
.
-
void *cli_userdata
This is passed to the
userdata
parameter ofcli_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 toSDL_WINDOWPOS_UNDEFINED
.
-
TCOD_Console *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.
New in version 1.19.
-
int tcod_version