Skip to content

Commit

Permalink
sdl2: avoid spamming warnings when setting relative mouse mode fails
Browse files Browse the repository at this point in the history
  • Loading branch information
john-tornblom committed Nov 16, 2024
1 parent 0ea0dbf commit c0eda78
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/client/vid/glimp_sdl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down

0 comments on commit c0eda78

Please sign in to comment.