Skip to content
Snippets Groups Projects
Commit 4656a0d0 authored by mazmazz's avatar mazmazz
Browse files

Merge branch 'sdl-autograb' into 'master'

SDL:Auto grab input

Closes #46

See merge request STJr/SRB2!416
parents 402860dc cb13ace7
No related branches found
No related tags found
2 merge requests!488Merge in next and don't billboard papersprites in GL,!416SDL:Auto grab input
......@@ -360,6 +360,7 @@ static INT32 Impl_SDL_Scancode_To_Keycode(SDL_Scancode code)
static void SDLdoUngrabMouse(void)
{
SDL_ShowCursor(SDL_ENABLE);
SDL_SetWindowGrab(window, SDL_FALSE);
wrapmouseok = SDL_FALSE;
SDL_SetRelativeMouseMode(SDL_FALSE);
......@@ -369,6 +370,7 @@ void SDLforceUngrabMouse(void)
{
if (SDL_WasInit(SDL_INIT_VIDEO)==SDL_INIT_VIDEO && window != NULL)
{
SDL_ShowCursor(SDL_ENABLE);
SDL_SetWindowGrab(window, SDL_FALSE);
wrapmouseok = SDL_FALSE;
SDL_SetRelativeMouseMode(SDL_FALSE);
......@@ -1553,9 +1555,18 @@ void I_StartupGraphics(void)
realheight = (Uint16)vid.height;
VID_Command_Info_f();
if (!disable_mouse) SDL_ShowCursor(SDL_DISABLE);
SDLdoUngrabMouse();
SDL_RaiseWindow(window);
if (mousegrabok && !disable_mouse)
{
SDL_ShowCursor(SDL_DISABLE);
SDL_SetRelativeMouseMode(SDL_TRUE);
wrapmouseok = SDL_TRUE;
SDL_SetWindowGrab(window, SDL_TRUE);
}
graphics_started = true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment