mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-12-11 05:00:59 +00:00
sdl2: avoid spamming warnings when setting relative mouse mode fails
This commit is contained in:
parent
0ea0dbf4ac
commit
c0eda78e43
1 changed files with 3 additions and 1 deletions
|
@ -720,13 +720,15 @@ GLimp_ShutdownGraphics(void)
|
|||
void
|
||||
GLimp_GrabInput(qboolean grab)
|
||||
{
|
||||
static qboolean seen_error = false;
|
||||
if(window != NULL)
|
||||
{
|
||||
SDL_SetWindowGrab(window, grab ? SDL_TRUE : SDL_FALSE);
|
||||
}
|
||||
|
||||
if(SDL_SetRelativeMouseMode(grab ? SDL_TRUE : SDL_FALSE) < 0)
|
||||
if(SDL_SetRelativeMouseMode(grab ? SDL_TRUE : SDL_FALSE) < 0 && !seen_error)
|
||||
{
|
||||
seen_error = true;
|
||||
Com_Printf("WARNING: Setting Relative Mousemode failed, reason: %s\n", SDL_GetError());
|
||||
Com_Printf(" You should probably update to SDL 2.0.3 or newer!\n");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue