Another attempt to lock the mouse

This commit is contained in:
Steel Titanium 2018-12-23 18:54:15 -05:00
parent 40a037f603
commit 46d1a866d8
1 changed files with 9 additions and 4 deletions

View File

@ -1319,10 +1319,6 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen)
return SDL_FALSE;
}
SDL_RaiseWindow(window);
SDL_SetRelativeMouseMode(SDL_TRUE);
SDL_SetWindowGrab(window, SDL_TRUE);
// Renderer-specific stuff
#ifdef HWRENDER
if (rendermode == render_opengl)
@ -1560,6 +1556,15 @@ void I_StartupGraphics(void)
if (!disable_mouse) SDL_ShowCursor(SDL_DISABLE);
SDLdoUngrabMouse();
SDL_RaiseWindow(window);
if (mousegrabok && !M_CheckParm("-nomouse"))
{
SDL_SetRelativeMouseMode(SDL_TRUE);
}
SDL_SetWindowGrab(window, SDL_TRUE);
graphics_started = true;
}