aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-01-07 16:48:38 +0100
committerkdx <kikoodx@paranoici.org>2023-01-07 16:48:38 +0100
commit278949bacaa12237f5c21ce7dc64e81b09f69c48 (patch)
tree459b10d32a0a3f7e4c51d452079e5819db4d8526
parent39c730648e34881f223cabbcf6083c63a76377c2 (diff)
downloadlzr-278949bacaa12237f5c21ce7dc64e81b09f69c48.tar.gz
config: hide cursor
-rw-r--r--demo.c3
-rw-r--r--lzr.c4
-rw-r--r--lzr.h1
3 files changed, 6 insertions, 2 deletions
diff --git a/demo.c b/demo.c
index 9238f3b..90892cf 100644
--- a/demo.c
+++ b/demo.c
@@ -1,10 +1,9 @@
#include "lzr.h"
-#include <dx/log.h>
#include <stdbool.h>
int main(void)
{
- LZR_Config cfg = {400, 224, 60, 16, "LZR demo", 0.0, false};
+ LZR_Config cfg = {400, 224, 60, 16, "LZR demo", 0.0, false, true};
if (LZR_Init(cfg))
return 1;
float darkness = 0.0f;
diff --git a/lzr.c b/lzr.c
index 1bb773a..6548f16 100644
--- a/lzr.c
+++ b/lzr.c
@@ -233,6 +233,10 @@ int LZR_Init(LZR_Config cfg)
min_dt = 1000 / config.target_fps;
next_time = SDL_GetTicks64();
}
+ if (config.hide_cursor && SDL_ShowCursor(SDL_DISABLE) < 0) {
+ SDL_Log("%s", SDL_GetError());
+ return -1;
+ }
return 0;
}
diff --git a/lzr.h b/lzr.h
index cafd35a..220d13e 100644
--- a/lzr.h
+++ b/lzr.h
@@ -35,6 +35,7 @@ typedef struct LZR_Config {
const char *title;
double ratio;
bool disable_bind_menu;
+ bool hide_cursor;
} LZR_Config;
typedef enum LZR_EventType {