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

View file

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