mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-15 07:00:58 +00:00
Capture mouse properly on macOS when outside of window, fixes issue #584
This commit is contained in:
parent
3b3e08510d
commit
041db6b348
2 changed files with 10 additions and 0 deletions
|
@ -366,6 +366,11 @@ bool GLimp_Init( glimpParms_t parms )
|
|||
{
|
||||
common->Printf( "Using GLEW %s\n", glewGetString( GLEW_VERSION ) );
|
||||
}
|
||||
|
||||
#if defined(__APPLE__) && SDL_VERSION_ATLEAST(2, 0, 2)
|
||||
// SRS - On OSX enable SDL2 relative mouse mode warping to capture mouse properly if outside of window
|
||||
SDL_SetHintWithPriority( SDL_HINT_MOUSE_RELATIVE_MODE_WARP, "1", SDL_HINT_OVERRIDE );
|
||||
#endif
|
||||
|
||||
// DG: disable cursor, we have two cursors in menu (because mouse isn't grabbed in menu)
|
||||
SDL_ShowCursor( SDL_DISABLE );
|
||||
|
|
|
@ -317,6 +317,11 @@ bool VKimp_Init( glimpParms_t parms )
|
|||
common->Printf( "No usable VK mode found: %s", SDL_GetError() );
|
||||
return false;
|
||||
}
|
||||
|
||||
#if defined(__APPLE__) && SDL_VERSION_ATLEAST(2, 0, 2)
|
||||
// SRS - On OSX enable SDL2 relative mouse mode warping to capture mouse properly if outside of window
|
||||
SDL_SetHintWithPriority( SDL_HINT_MOUSE_RELATIVE_MODE_WARP, "1", SDL_HINT_OVERRIDE );
|
||||
#endif
|
||||
|
||||
// DG: disable cursor, we have two cursors in menu (because mouse isn't grabbed in menu)
|
||||
SDL_ShowCursor( SDL_DISABLE );
|
||||
|
|
Loading…
Reference in a new issue