mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-18 07:05:39 +00:00
Hide and unhide mouse cursor via SDL on startup
This can also be made permanent by setting the environment variable SDL_NOMOUSE=1 or 0, e.g. in $home/.bashrc
This commit is contained in:
parent
762952e7ea
commit
01d5f1e085
|
@ -20,6 +20,8 @@ extern bool WINDOWED;
|
|||
|
||||
namespace Renderer
|
||||
{
|
||||
static bool initialCursorState;
|
||||
|
||||
unsigned int display_width = 0;
|
||||
unsigned int display_height = 0;
|
||||
|
||||
|
@ -85,6 +87,9 @@ namespace Renderer
|
|||
|
||||
LOG(LogInfo) << "Created surface successfully.";
|
||||
|
||||
//hide mouse cursor
|
||||
initialCursorState = SDL_ShowCursor(0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -98,6 +103,10 @@ namespace Renderer
|
|||
{
|
||||
SDL_FreeSurface(sdlScreen);
|
||||
sdlScreen = NULL;
|
||||
|
||||
//show mouse cursor
|
||||
SDL_ShowCursor(initialCursorState);
|
||||
|
||||
SDL_Quit();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue