mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-01-21 00:41:05 +00:00
Port window event handling to SDL3.
This commit is contained in:
parent
a81b065893
commit
d315f02a7b
1 changed files with 57 additions and 58 deletions
|
@ -658,14 +658,9 @@ IN_Update(void)
|
|||
break;
|
||||
}
|
||||
|
||||
case SDL_WINDOWEVENT:
|
||||
if (event.window.event == SDL_EVENT_WINDOW_FOCUS_LOST ||
|
||||
event.window.event == SDL_EVENT_WINDOW_FOCUS_GAINED)
|
||||
case SDL_EVENT_WINDOW_FOCUS_LOST:
|
||||
{
|
||||
Key_MarkAllUp();
|
||||
|
||||
if (event.window.event == SDL_EVENT_WINDOW_FOCUS_LOST)
|
||||
{
|
||||
S_Activate(false);
|
||||
|
||||
if (windowed_pauseonfocuslost->value != 1)
|
||||
|
@ -679,9 +674,10 @@ IN_Update(void)
|
|||
{
|
||||
Cbuf_AddText("ogg toggle\n");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (event.window.event == SDL_EVENT_WINDOW_FOCUS_GAINED)
|
||||
case SDL_EVENT_WINDOW_FOCUS_GAINED:
|
||||
{
|
||||
S_Activate(true);
|
||||
|
||||
|
@ -697,15 +693,18 @@ IN_Update(void)
|
|||
{
|
||||
Cbuf_AddText("ogg toggle\n");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (event.window.event == SDL_EVENT_WINDOW_MOVED)
|
||||
|
||||
case SDL_EVENT_WINDOW_MOVED:
|
||||
{
|
||||
// make sure GLimp_GetRefreshRate() will query from SDL again - the window might
|
||||
// be on another display now!
|
||||
glimp_refreshRate = -1.0;
|
||||
break;
|
||||
}
|
||||
else if (event.window.event == SDL_EVENT_WINDOW_SHOWN)
|
||||
|
||||
case SDL_EVENT_WINDOW_SHOWN:
|
||||
{
|
||||
if (cl_unpaused_scvis->value > 0)
|
||||
{
|
||||
|
@ -719,8 +718,8 @@ IN_Update(void)
|
|||
{
|
||||
Cbuf_AddText("ogg toggle\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case SDL_EVENT_GAMEPAD_BUTTON_UP :
|
||||
case SDL_EVENT_GAMEPAD_BUTTON_DOWN :
|
||||
|
|
Loading…
Reference in a new issue