Fixes the Alt + Tab crash in the fullscreen mode. Refs #4181.

Patch By: Angen
Comments By: echotangoecho, Imarok, Stan
Reviewed By: vladislavbelov
Trac Tickets: #4181
Differential Revision: https://code.wildfiregames.com/D1212
This was SVN commit r21476.
This commit is contained in:
vladislavbelov
2018-03-09 22:23:03 +00:00
parent 2f763f1d87
commit 0e710d716d
3 changed files with 18 additions and 7 deletions
+6 -5
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -304,8 +304,7 @@ static void Frame()
#endif
ENSURE(realTimeSinceLastFrame > 0.0f);
// decide if update/render is necessary
bool need_render = !g_app_minimized;
// Decide if update is necessary
bool need_update = true;
// If we are not running a multiplayer game, disable updates when the game is
@@ -369,9 +368,11 @@ static void Frame()
g_UserReporter.Update();
g_Console->Update(realTimeSinceLastFrame);
ogl_WarnIfError();
if (need_render)
// We do not have to render an inactive fullscreen frame, because it can
// lead to errors for some graphic card families.
if (!g_app_minimized && (g_app_has_focus || !g_VideoMode.IsInFullscreen()))
{
Render();