43TCOD_DEPRECATED(
"The libtcod event API has been deprecated, switch to using SDL event types exclusively")
44typedef enum TCOD_event_t {
46 TCOD_EVENT_KEY_PRESS = 1,
47 TCOD_EVENT_KEY_RELEASE = 2,
48 TCOD_EVENT_KEY = TCOD_EVENT_KEY_PRESS | TCOD_EVENT_KEY_RELEASE,
49 TCOD_EVENT_MOUSE_MOVE = 4,
50 TCOD_EVENT_MOUSE_PRESS = 8,
51 TCOD_EVENT_MOUSE_RELEASE = 16,
52 TCOD_EVENT_MOUSE = TCOD_EVENT_MOUSE_MOVE | TCOD_EVENT_MOUSE_PRESS | TCOD_EVENT_MOUSE_RELEASE,
54 TCOD_EVENT_FINGER_MOVE = 32,
55 TCOD_EVENT_FINGER_PRESS = 64,
56 TCOD_EVENT_FINGER_RELEASE = 128,
57 TCOD_EVENT_FINGER = TCOD_EVENT_FINGER_MOVE | TCOD_EVENT_FINGER_PRESS | TCOD_EVENT_FINGER_RELEASE,
59 TCOD_EVENT_ANY = TCOD_EVENT_KEY | TCOD_EVENT_MOUSE | TCOD_EVENT_FINGER,
63typedef void (*SDL_renderer_t)(
struct SDL_Surface* sdl_renderer);
66typedef void* TCOD_thread_t;
67typedef void* TCOD_semaphore_t;
68typedef void* TCOD_mutex_t;
69typedef void* TCOD_cond_t;
74TCODLIB_API
void TCOD_sys_startup(
void);
75TCODLIB_API
void TCOD_sys_shutdown(
void);
78TCOD_DEPRECATED_NOMESSAGE
79TCODLIB_API
bool TCOD_sys_create_directory(
const char* path);
80TCOD_DEPRECATED_NOMESSAGE
81TCODLIB_API
bool TCOD_sys_delete_file(
const char* path);
82TCOD_DEPRECATED_NOMESSAGE
83TCODLIB_API
bool TCOD_sys_delete_directory(
const char* path);
84TCOD_DEPRECATED_NOMESSAGE
85TCODLIB_API
bool TCOD_sys_is_directory(
const char* path);
86TCOD_DEPRECATED_NOMESSAGE
87TCODLIB_API TCOD_list_t TCOD_sys_get_directory_content(
const char* path,
const char* pattern);
88TCOD_DEPRECATED_NOMESSAGE
89TCODLIB_API
bool TCOD_sys_file_exists(
const char* filename, ...);
90TCOD_DEPRECATED_NOMESSAGE
91TCODLIB_API
bool TCOD_sys_read_file(
const char* filename,
unsigned char** buf,
size_t* size);
92TCOD_DEPRECATED_NOMESSAGE
93TCODLIB_API
bool TCOD_sys_write_file(
const char* filename,
unsigned char* buf, uint32_t size);
94#ifndef TCOD_NO_THREADS
96TCOD_DEPRECATED_NOMESSAGE
97TCODLIB_API TCOD_thread_t TCOD_thread_new(
int (*func)(
void*),
void* data);
98TCOD_DEPRECATED_NOMESSAGE
99TCODLIB_API
void TCOD_thread_delete(TCOD_thread_t th);
100TCOD_DEPRECATED_NOMESSAGE
101TCODLIB_API
int TCOD_sys_get_num_cores(
void);
102TCOD_DEPRECATED_NOMESSAGE
103TCODLIB_API
void TCOD_thread_wait(TCOD_thread_t th);
105TCOD_DEPRECATED_NOMESSAGE
106TCODLIB_API TCOD_mutex_t TCOD_mutex_new(
void);
107TCOD_DEPRECATED_NOMESSAGE
108TCODLIB_API
void TCOD_mutex_in(TCOD_mutex_t mut);
109TCOD_DEPRECATED_NOMESSAGE
110TCODLIB_API
void TCOD_mutex_out(TCOD_mutex_t mut);
111TCOD_DEPRECATED_NOMESSAGE
112TCODLIB_API
void TCOD_mutex_delete(TCOD_mutex_t mut);
114TCOD_DEPRECATED_NOMESSAGE
115TCODLIB_API TCOD_semaphore_t TCOD_semaphore_new(
int initVal);
116TCOD_DEPRECATED_NOMESSAGE
117TCODLIB_API
void TCOD_semaphore_lock(TCOD_semaphore_t sem);
118TCOD_DEPRECATED_NOMESSAGE
119TCODLIB_API
void TCOD_semaphore_unlock(TCOD_semaphore_t sem);
120TCOD_DEPRECATED_NOMESSAGE
121TCODLIB_API
void TCOD_semaphore_delete(TCOD_semaphore_t sem);
123TCOD_DEPRECATED_NOMESSAGE
124TCODLIB_API TCOD_cond_t TCOD_condition_new(
void);
125TCOD_DEPRECATED_NOMESSAGE
126TCODLIB_API
void TCOD_condition_signal(TCOD_cond_t sem);
127TCOD_DEPRECATED_NOMESSAGE
128TCODLIB_API
void TCOD_condition_broadcast(TCOD_cond_t sem);
129TCOD_DEPRECATED_NOMESSAGE
130TCODLIB_API
void TCOD_condition_wait(TCOD_cond_t sem, TCOD_mutex_t mut);
131TCOD_DEPRECATED_NOMESSAGE
132TCODLIB_API
void TCOD_condition_delete(TCOD_cond_t sem);
136typedef void* TCOD_library_t;
137TCOD_DEPRECATED_NOMESSAGE
138TCODLIB_API TCOD_library_t TCOD_load_library(
const char* path);
139TCOD_DEPRECATED_NOMESSAGE
140TCODLIB_API
void* TCOD_get_function_address(TCOD_library_t library,
const char* function_name);
141TCOD_DEPRECATED_NOMESSAGE
142TCODLIB_API
void TCOD_close_library(TCOD_library_t);
152TCOD_DEPRECATED(
"Use SDL_GetTicks instead.")
162TCOD_DEPRECATED(
"Use SDL_GetTicks instead.")
172TCOD_DEPRECATED(
"Use SDL_Delay instead.")
183TCOD_DEPRECATED(
"This function is not compatible with contexts. Use tcod::Timer or SDL timing functions instead.")
194TCOD_DEPRECATED(
"This function is not compatible with contexts. Use tcod::Timer or SDL timing functions instead.")
205TCOD_DEPRECATED(
"This function is not compatible with contexts. Use tcod::Timer or SDL timing functions instead.")
208TCOD_DEPRECATED(
"This function is not compatible with contexts.")
209TCODLIB_API
void TCOD_sys_save_screenshot(const
char* filename);
210TCOD_DEPRECATED(
"This function is not compatible with contexts.")
211TCODLIB_API
void TCOD_sys_force_fullscreen_resolution(
int width,
int height);
212TCOD_DEPRECATED(
"This function is not compatible with contexts.")
213TCODLIB_API TCOD_NODISCARD
int TCOD_sys_set_renderer(
TCOD_renderer_t renderer);
214TCOD_DEPRECATED(
"This function is not compatible with contexts.")
219TCOD_DEPRECATED(
"Use SDL to determine the screen resolution instead.")
221TCOD_DEPRECATED(
"This function is not compatible with contexts.")
222TCODLIB_API
void TCOD_sys_get_fullscreen_offsets(
int* offset_x,
int* offset_y);
223TCOD_DEPRECATED(
"This function is not compatible with contexts.")
224TCODLIB_API
void TCOD_sys_get_char_size(
int* w,
int* h);
239TCODLIB_API struct SDL_Window* TCOD_sys_get_SDL_window(
void);
240TCODLIB_API struct SDL_Renderer* TCOD_sys_get_SDL_renderer(
void);
242TCODLIB_BEGIN_IGNORE_DEPRECATIONS
243TCOD_DEPRECATED(
"This API is deprecated, use SDL_WaitEvent instead.")
244TCODLIB_API TCOD_event_t TCOD_sys_wait_for_event(
int eventMask,
TCOD_key_t* key,
TCOD_mouse_t* mouse,
bool flush);
245TCOD_DEPRECATED(
"This API is deprecated, use SDL_PollEvent instead.")
247TCODLIB_END_IGNORE_DEPRECATIONS
250TCOD_DEPRECATED(
"Use the SDL API to handle the clipboard.")
251TCODLIB_API
bool TCOD_sys_clipboard_set(const
char* value);
252TCOD_DEPRECATED(
"Use the SDL API to handle the clipboard.")
253TCODLIB_API
char* TCOD_sys_clipboard_get(
void);
256TCOD_DEPRECATED_NOMESSAGE
257TCODLIB_API
void TCOD_sys_register_SDL_renderer(SDL_renderer_t renderer);
TCOD_renderer_t
Libtcod rendering modes.
Definition console_types.h:491
TCOD_Error
An enum of libtcod error codes.
Definition error.h:48
Deprecated libtcod list module.
Mouse state provided by the libtcod event system.
Miscellaneous tools needed across platforms.
Libtcod key event data, as a keycode or text character.
Definition console_types.h:207
Mouse state provided by the libtcod event system.
Definition mouse_types.h:50
uint32_t TCOD_sys_elapsed_milli(void)
Alias for SDL_GetTicks.
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_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.
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.
TCOD_Error TCOD_sys_get_current_resolution(int *w, int *h)
Return the resolution of the current monitor.
void TCOD_sys_set_fps(int val)
Set the desired framerate.