diff options
author | kdx <kikoodx@paranoici.org> | 2023-01-07 16:48:38 +0100 |
---|---|---|
committer | kdx <kikoodx@paranoici.org> | 2023-01-07 16:48:38 +0100 |
commit | 278949bacaa12237f5c21ce7dc64e81b09f69c48 (patch) | |
tree | 459b10d32a0a3f7e4c51d452079e5819db4d8526 | |
parent | 39c730648e34881f223cabbcf6083c63a76377c2 (diff) | |
download | lzr-278949bacaa12237f5c21ce7dc64e81b09f69c48.tar.gz |
config: hide cursor
-rw-r--r-- | demo.c | 3 | ||||
-rw-r--r-- | lzr.c | 4 | ||||
-rw-r--r-- | lzr.h | 1 |
3 files changed, 6 insertions, 2 deletions
@@ -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; @@ -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; } @@ -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 { |