- skip rendering when application is not active

Use vid_activeinbackground CVAR to override this behavior
This commit is contained in:
alexey.lysiuk 2018-05-04 11:24:37 +03:00
commit 2be84dc636
11 changed files with 25 additions and 45 deletions

View file

@ -305,9 +305,16 @@ void MessagePump (const SDL_Event &sev)
case SDL_WINDOWEVENT:
switch (sev.window.event)
{
extern bool AppActive;
case SDL_WINDOWEVENT_FOCUS_GAINED:
S_SetSoundPaused(1);
AppActive = true;
break;
case SDL_WINDOWEVENT_FOCUS_LOST:
S_SetSoundPaused((!!i_soundinbackground) || sev.window.event == SDL_WINDOWEVENT_FOCUS_GAINED);
S_SetSoundPaused(i_soundinbackground);
AppActive = false;
break;
}
break;