- skip rendering when application is not active
Use vid_activeinbackground CVAR to override this behavior
This commit is contained in:
parent
311259b0f5
commit
2be84dc636
11 changed files with 25 additions and 45 deletions
|
|
@ -65,7 +65,6 @@ protected:
|
|||
|
||||
void InitializeState();
|
||||
|
||||
bool CanUpdate();
|
||||
void SwapBuffers();
|
||||
|
||||
void SetGammaTable(uint16_t* table);
|
||||
|
|
|
|||
|
|
@ -296,18 +296,24 @@ ApplicationController* appCtrl;
|
|||
}
|
||||
|
||||
|
||||
extern bool AppActive;
|
||||
|
||||
- (void)applicationDidBecomeActive:(NSNotification*)aNotification
|
||||
{
|
||||
ZD_UNUSED(aNotification);
|
||||
|
||||
S_SetSoundPaused(1);
|
||||
|
||||
AppActive = true;
|
||||
}
|
||||
|
||||
- (void)applicationWillResignActive:(NSNotification*)aNotification
|
||||
{
|
||||
ZD_UNUSED(aNotification);
|
||||
|
||||
S_SetSoundPaused((!!i_soundinbackground) || 0);
|
||||
S_SetSoundPaused(i_soundinbackground);
|
||||
|
||||
AppActive = false;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -701,11 +701,6 @@ void SystemFrameBuffer::InitializeState()
|
|||
{
|
||||
}
|
||||
|
||||
bool SystemFrameBuffer::CanUpdate()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void SystemFrameBuffer::SwapBuffers()
|
||||
{
|
||||
[[NSOpenGLContext currentContext] flushBuffer];
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ public:
|
|||
virtual int GetTrueHeight() { return GetClientHeight(); }
|
||||
|
||||
protected:
|
||||
bool CanUpdate();
|
||||
void SetGammaTable(uint16_t *tbl);
|
||||
void ResetGammaTable();
|
||||
void InitializeState();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -394,11 +394,6 @@ void SystemFrameBuffer::InitializeState()
|
|||
{
|
||||
}
|
||||
|
||||
bool SystemFrameBuffer::CanUpdate ()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void SystemFrameBuffer::SetGammaTable(uint16_t *tbl)
|
||||
{
|
||||
if (m_supportsGamma)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue