libtcod
Loading...
Searching...
No Matches
sys.h File Reference

Deprecated low-level functions. More...

#include "image.h"
#include "list.h"
#include "mouse_types.h"
#include "portability.h"

Go to the source code of this file.

Typedefs

typedef enum TCOD_event_t TCOD_event_t
typedef void(* SDL_renderer_t) (struct SDL_Surface *sdl_renderer)
typedef void * TCOD_thread_t
typedef void * TCOD_semaphore_t
typedef void * TCOD_mutex_t
typedef void * TCOD_cond_t
typedef void * TCOD_library_t

Enumerations

enum  TCOD_event_t {
  TCOD_EVENT_NONE = 0 , TCOD_EVENT_KEY_PRESS = 1 , TCOD_EVENT_KEY_RELEASE = 2 , TCOD_EVENT_KEY = TCOD_EVENT_KEY_PRESS | TCOD_EVENT_KEY_RELEASE ,
  TCOD_EVENT_MOUSE_MOVE = 4 , TCOD_EVENT_MOUSE_PRESS = 8 , TCOD_EVENT_MOUSE_RELEASE = 16 , TCOD_EVENT_MOUSE = TCOD_EVENT_MOUSE_MOVE | TCOD_EVENT_MOUSE_PRESS | TCOD_EVENT_MOUSE_RELEASE ,
  TCOD_EVENT_FINGER_MOVE = 32 , TCOD_EVENT_FINGER_PRESS = 64 , TCOD_EVENT_FINGER_RELEASE = 128 , TCOD_EVENT_FINGER = TCOD_EVENT_FINGER_MOVE | TCOD_EVENT_FINGER_PRESS | TCOD_EVENT_FINGER_RELEASE ,
  TCOD_EVENT_ANY = TCOD_EVENT_KEY | TCOD_EVENT_MOUSE | TCOD_EVENT_FINGER
}

Functions

void TCOD_sys_startup (void)
void TCOD_sys_shutdown (void)
bool TCOD_sys_create_directory (const char *path)
bool TCOD_sys_delete_file (const char *path)
bool TCOD_sys_delete_directory (const char *path)
bool TCOD_sys_is_directory (const char *path)
TCOD_list_t TCOD_sys_get_directory_content (const char *path, const char *pattern)
bool TCOD_sys_file_exists (const char *filename,...)
bool TCOD_sys_read_file (const char *filename, unsigned char **buf, size_t *size)
bool TCOD_sys_write_file (const char *filename, unsigned char *buf, uint32_t size)
TCOD_thread_t TCOD_thread_new (int(*func)(void *), void *data)
void TCOD_thread_delete (TCOD_thread_t th)
int TCOD_sys_get_num_cores (void)
void TCOD_thread_wait (TCOD_thread_t th)
TCOD_mutex_t TCOD_mutex_new (void)
void TCOD_mutex_in (TCOD_mutex_t mut)
void TCOD_mutex_out (TCOD_mutex_t mut)
void TCOD_mutex_delete (TCOD_mutex_t mut)
TCOD_semaphore_t TCOD_semaphore_new (int initVal)
void TCOD_semaphore_lock (TCOD_semaphore_t sem)
void TCOD_semaphore_unlock (TCOD_semaphore_t sem)
void TCOD_semaphore_delete (TCOD_semaphore_t sem)
TCOD_cond_t TCOD_condition_new (void)
void TCOD_condition_signal (TCOD_cond_t sem)
void TCOD_condition_broadcast (TCOD_cond_t sem)
void TCOD_condition_wait (TCOD_cond_t sem, TCOD_mutex_t mut)
void TCOD_condition_delete (TCOD_cond_t sem)
TCOD_library_t TCOD_load_library (const char *path)
void * TCOD_get_function_address (TCOD_library_t library, const char *function_name)
void TCOD_close_library (TCOD_library_t)
uint32_t TCOD_sys_elapsed_milli (void)
 Alias for SDL_GetTicks.
float TCOD_sys_elapsed_seconds (void)
 Returns the number of seconds since the start of the program.
void TCOD_sys_sleep_milli (uint32_t val)
 Alias for SDL_Delay.
void TCOD_sys_set_fps (int val)
 Set the desired framerate.
int TCOD_sys_get_fps (void)
 Get the current framerate.
float TCOD_sys_get_last_frame_length (void)
 Get the delta time between the last two frames.
void TCOD_sys_save_screenshot (const char *filename)
void TCOD_sys_force_fullscreen_resolution (int width, int height)
int TCOD_sys_set_renderer (TCOD_renderer_t renderer)
TCOD_renderer_t TCOD_sys_get_renderer (void)
TCOD_Error TCOD_sys_get_current_resolution (int *w, int *h)
 Return the resolution of the current monitor.
void TCOD_sys_get_fullscreen_offsets (int *offset_x, int *offset_y)
void TCOD_sys_get_char_size (int *w, int *h)
void TCOD_sys_update_char (int asciiCode, int font_x, int font_y, const TCOD_Image *img, int x, int y)
 Upload a tile to the active tileset.
struct SDL_Window * TCOD_sys_get_SDL_window (void)
struct SDL_Renderer * TCOD_sys_get_SDL_renderer (void)
TCODLIB_BEGIN_IGNORE_DEPRECATIONS TCOD_event_t TCOD_sys_wait_for_event (int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse, bool flush)
TCOD_event_t TCOD_sys_check_for_event (int eventMask, TCOD_key_t *key, TCOD_mouse_t *mouse)
TCODLIB_END_IGNORE_DEPRECATIONS bool TCOD_sys_clipboard_set (const char *value)
char * TCOD_sys_clipboard_get (void)
void TCOD_sys_register_SDL_renderer (SDL_renderer_t renderer)

Detailed Description

Deprecated low-level functions.

Function Documentation

◆ TCOD_sys_elapsed_milli()

uint32_t TCOD_sys_elapsed_milli ( void )

Alias for SDL_GetTicks.

embed:rst:leading-asterisk 
.. deprecated:: 1.19
    You should call SDL_GetTicks directly.

◆ TCOD_sys_elapsed_seconds()

float TCOD_sys_elapsed_seconds ( void )

Returns the number of seconds since the start of the program.

embed:rst:leading-asterisk 
.. deprecated:: 1.19
    Use SDL_GetTicks and convert the result into seconds instead of using this function.

◆ TCOD_sys_get_fps()

int TCOD_sys_get_fps ( void )

Get the current framerate.

embed:rst:leading-asterisk 
.. deprecated:: 1.19
    This function will not work with libtcod contexts.
    Use tcod::Timer instead.

◆ TCOD_sys_get_last_frame_length()

float TCOD_sys_get_last_frame_length ( void )

Get the delta time between the last two frames.

(in seconds)

embed:rst:leading-asterisk 
.. deprecated:: 1.19
    This function will not work with libtcod contexts.
    Use tcod::Timer instead.

◆ TCOD_sys_set_fps()

void TCOD_sys_set_fps ( int val)

Set the desired framerate.

embed:rst:leading-asterisk 
.. deprecated:: 1.19
    This function will not affect libtcod contexts.
    Set the framerate with tcod::Timer instead.

◆ TCOD_sys_sleep_milli()

void TCOD_sys_sleep_milli ( uint32_t val)

Alias for SDL_Delay.

embed:rst:leading-asterisk 
.. deprecated:: 1.19
    You should call SDL_Delay directly.

◆ TCOD_sys_update_char()

void TCOD_sys_update_char ( int asciiCode,
int font_x,
int font_y,
const TCOD_Image * img,
int x,
int y )

Upload a tile to the active tileset.

asciiCode is the Unicode codepoint for this tile.

font_x and font_y are the tile-coordinates on the active tilemap.

img is the tile to upload.

x and y are the upper-left pixel-coordinates of the tile on the img.