From 073e51e7294269d712bfd5872e10b242ccbfb475 Mon Sep 17 00:00:00 2001 From: Naomino <66085784+Naomi-Kali@users.noreply.github.com> Date: Sun, 7 Jul 2024 20:04:37 +0200 Subject: [PATCH] HideCursor Config Option inside the config to hide/show cursor during SDL3 --- src/common/config.cpp | 5 +++++ src/common/config.h | 1 + src/sdl_window.cpp | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common/config.cpp b/src/common/config.cpp index f23b9d652..26c2ad060 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -11,6 +11,7 @@ namespace Config { static bool isNeo = false; static bool isFullscreen = false; +static bool hideCursor = true; static u32 screenWidth = 1280; static u32 screenHeight = 720; static s32 gpuId = -1; // Vulkan physical device index. Set to negative for auto select @@ -54,6 +55,10 @@ bool isFullscreenMode() { return isFullscreen; } +bool isHideCursor() { + return hideCursor; +} + u32 getScreenWidth() { return screenWidth; } diff --git a/src/common/config.h b/src/common/config.h index 0a3b4905e..c9c0e9a3f 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -13,6 +13,7 @@ void save(const std::filesystem::path& path); bool isNeoMode(); bool isFullscreenMode(); +bool isHideCursor(); std::string getLogFilter(); std::string getLogType(); diff --git a/src/sdl_window.cpp b/src/sdl_window.cpp index 05bd190b7..5baf0982a 100644 --- a/src/sdl_window.cpp +++ b/src/sdl_window.cpp @@ -45,7 +45,7 @@ WindowSDL::WindowSDL(s32 width_, s32 height_, Input::GameController* controller_ } SDL_SetWindowFullscreen(window, Config::isFullscreenMode()); - CursorVisibility(true); + CursorVisibility(Config::isHideCursor()); #if defined(SDL_PLATFORM_WIN32) window_info.type = WindowSystemType::Windows;