libtcod
Loading...
Searching...
No Matches
tcod Namespace Reference

The libtcod namespace. More...

Classes

struct  ColorRGB
 A C++ RGB color, used to handle conversions between color types. More...
 
struct  ColorRGBA
 A C++ RGBA color, used to handle conversions between color types. More...
 
struct  ConsoleDeleter
 
struct  ContextDeleter
 
struct  ImageDeleter
 
struct  MapDeleter_
 
class  Matrix
 A template container for holding a multi-dimensional array of items. More...
 
class  MatrixView
 A view into a strided multi-dimensional array. More...
 

Typedefs

typedef std::unique_ptr< struct TCOD_Console, ConsoleDeleterConsolePtr
 A unique pointer to a TCOD_Console.
 
typedef std::unique_ptr< TCOD_Context, ContextDeleterContextPtr
 
typedef std::shared_ptr< TCOD_ContextContextSharedPtr
 
typedef std::unique_ptr< TCOD_Image, ImageDeleterImagePtr
 A unique pointer to a TCOD_Image.
 

Functions

void blit (TCOD_Console &dest, const TCOD_Console &source, const std::array< int, 2 > &dest_xy={0, 0}, std::array< int, 4 > source_rect={0, 0, 0, 0}, float foreground_alpha=1.0f, float background_alpha=1.0f)
 Blit a region of tiles from one console to another.
 
TCOD_Error set_error (const std::string &msg)
 Set an error message and return a relevant error code, usually -1.
 
TCOD_Error set_error (const std::exception &e)
 
int check_throw_error (int error)
 Check and throw error messages.
 
TCOD_Error check_throw_error (TCOD_Error error)
 
void check_path (const std::filesystem::path &path)
 Throw an exception if the given path does not exist.
 

Detailed Description

The libtcod namespace.

Typedef Documentation

◆ ConsolePtr

typedef std::unique_ptr<struct TCOD_Console, ConsoleDeleter> tcod::ConsolePtr

A unique pointer to a TCOD_Console.

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

◆ ImagePtr

typedef std::unique_ptr<TCOD_Image, ImageDeleter> tcod::ImagePtr

A unique pointer to a TCOD_Image.

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

Function Documentation

◆ check_path()

void tcod::check_path ( const std::filesystem::path & path)
inline

Throw an exception if the given path does not exist.

Used internally.

◆ check_throw_error()

int tcod::check_throw_error ( int error)
inline

Check and throw error messages.

Used internally.

◆ set_error()

TCOD_Error tcod::set_error ( const std::string & msg)
inline

Set an error message and return a relevant error code, usually -1.

Used internally.