Pause the game when the window loses input focus.

This commit is contained in:
Guus Sliepen 2011-09-05 11:41:03 +02:00
parent f8c4a72170
commit 350aabfa23
1 changed files with 1 additions and 1 deletions

View File

@ -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;