- 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

@ -30,7 +30,6 @@ public:
protected:
bool CanUpdate();
void ResetGammaTable();
void SetGammaTable(uint16_t * tbl);

View file

@ -144,7 +144,7 @@ LPDIRECTINPUT8 g_pdi;
LPDIRECTINPUT g_pdi3;
BOOL AppActive = TRUE;
extern bool AppActive;
int SessionState = 0;
int BlockMouseMove;
@ -527,7 +527,7 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
break;
case WM_ACTIVATEAPP:
AppActive = wParam;
AppActive = wParam == TRUE;
if (wParam)
{
SetPriorityClass (GetCurrentProcess (), INGAME_PRIORITY_CLASS);

View file

@ -55,7 +55,6 @@
#include "gl/system/gl_framebuffer.h"
extern HWND Window;
extern BOOL AppActive;
extern "C" {
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
@ -71,8 +70,6 @@ PFNWGLSWAPINTERVALEXTPROC myWglSwapIntervalExtProc;
CVAR(Bool, vid_activeinbackground, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CUSTOM_CVAR(Bool, gl_debug, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
{
Printf("This won't take effect until " GAMENAME " is restarted.\n");
@ -1118,18 +1115,6 @@ void SystemFrameBuffer::InitializeState()
//
//==========================================================================
bool SystemFrameBuffer::CanUpdate()
{
if (!AppActive && (IsFullscreen() || !vid_activeinbackground)) return false;
return true;
}
//==========================================================================
//
//
//
//==========================================================================
void SystemFrameBuffer::ResetGammaTable()
{
if (m_supportsGamma)