From 6c85526fcd08fcff8c530120fe437c4193cd6308 Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Tue, 15 Aug 2023 19:44:58 +0200 Subject: [PATCH] Hide mouse cursor in fullscreen; close #23 --- src/platform_sdl.c | 4 +++- src/platform_sokol.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/platform_sdl.c b/src/platform_sdl.c index 830319e..e68ff76 100755 --- a/src/platform_sdl.c +++ b/src/platform_sdl.c @@ -193,9 +193,11 @@ void platform_set_fullscreen(bool fullscreen) { SDL_GetDesktopDisplayMode(display, &mode); SDL_SetWindowDisplayMode(window, &mode); SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN); + SDL_ShowCursor(SDL_DISABLE); } else { - SDL_SetWindowFullscreen(window, 0); + SDL_SetWindowFullscreen(window, 0); + SDL_ShowCursor(SDL_ENABLE); } } diff --git a/src/platform_sokol.c b/src/platform_sokol.c index 89b3a89..ef1087e 100644 --- a/src/platform_sokol.c +++ b/src/platform_sokol.c @@ -161,6 +161,7 @@ void platform_set_fullscreen(bool fullscreen) { } sapp_toggle_fullscreen(); + sapp_show_mouse(!fullscreen); } void platform_handle_event(const sapp_event* ev) {