Pause the game when the window loses input focus.
This commit is contained in:
parent
f8c4a72170
commit
350aabfa23
|
@ -188,7 +188,7 @@ void doPlayer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (engine.keyState[SDLK_p])
|
if (engine.keyState[SDLK_p] || !(SDL_GetAppState() & SDL_APPINPUTFOCUS))
|
||||||
{
|
{
|
||||||
engine.paused = true;
|
engine.paused = true;
|
||||||
engine.keyState[SDLK_p] = 0;
|
engine.keyState[SDLK_p] = 0;
|
||||||
|
|
Loading…
Reference in New Issue