From adfe71c6848e73da65fc91bbc745de4b0be29ce9 Mon Sep 17 00:00:00 2001 From: kdx Date: Tue, 28 Mar 2023 03:57:12 +0000 Subject: show/hide cursor --- headers/TZR.h | 1 + headers/TZR_globals.h | 1 - headers/TZR_types.h | 1 + sources/TZR_Init.c | 8 ++------ sources/globals.c | 1 - 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/headers/TZR.h b/headers/TZR.h index 1af2f40..06e3714 100644 --- a/headers/TZR.h +++ b/headers/TZR.h @@ -15,6 +15,7 @@ .height=224, \ .target_fps=60, \ .pixel_perfect=true, \ + .show_cursor=false, \ .title="TZR", \ ._=0, __VA_ARGS__ }) diff --git a/headers/TZR_globals.h b/headers/TZR_globals.h index 548110b..a6eaac7 100644 --- a/headers/TZR_globals.h +++ b/headers/TZR_globals.h @@ -17,7 +17,6 @@ extern unsigned long ___tzr_min_dt; extern int ___tzr_should_quit; extern int ___tzr_mouse_x; extern int ___tzr_mouse_y; -extern const char *___tzr_command[___TZR_RES_COUNT]; extern TZR_KeyState ___tzr_keystates[SDL_NUM_SCANCODES]; extern TZR_KeyState ___tzr_mousestates[256]; extern float ___tzr_scale; diff --git a/headers/TZR_types.h b/headers/TZR_types.h index 2377614..32f734a 100644 --- a/headers/TZR_types.h +++ b/headers/TZR_types.h @@ -41,6 +41,7 @@ struct TZR_Config { int height; int target_fps; bool pixel_perfect; + bool show_cursor; const char *title; }; diff --git a/sources/TZR_Init.c b/sources/TZR_Init.c index ce09a3c..7f80978 100644 --- a/sources/TZR_Init.c +++ b/sources/TZR_Init.c @@ -62,11 +62,7 @@ _TZR_Init(const TZR_Config *config) ___tzr_next_time = SDL_GetTicks64(); } - ___tzr_command[TZR_RES_RAW] = getenv("TZR_EDIT_RAW"); - if (___tzr_command[TZR_RES_RAW] == NULL) - ___tzr_command[TZR_RES_RAW] = "foot nvim"; - ___tzr_command[TZR_RES_IMAGE] = getenv("TZR_EDIT_IMAGE"); - if (___tzr_command[TZR_RES_IMAGE] == NULL) - ___tzr_command[TZR_RES_IMAGE] = "gimp"; + if (!___tzr_config.show_cursor) + SDL_ShowCursor(0); return 0; } diff --git a/sources/globals.c b/sources/globals.c index 7c4f26b..712edbf 100644 --- a/sources/globals.c +++ b/sources/globals.c @@ -17,7 +17,6 @@ unsigned long ___tzr_min_dt = 0; int ___tzr_should_quit = 0; int ___tzr_mouse_x = 0; int ___tzr_mouse_y = 0; -const char *___tzr_command[___TZR_RES_COUNT] = {}; TZR_KeyState ___tzr_keystates[SDL_NUM_SCANCODES] = {}; TZR_KeyState ___tzr_mousestates[256] = {}; //doc says than mouse button is u8 float ___tzr_scale = 1.0; -- cgit v1.2.3