Index: ps/trunk/source/main.cpp =================================================================== --- ps/trunk/source/main.cpp +++ ps/trunk/source/main.cpp @@ -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 @@ #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 @@ 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(); Index: ps/trunk/source/ps/VideoMode.h =================================================================== --- ps/trunk/source/ps/VideoMode.h +++ ps/trunk/source/ps/VideoMode.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014 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 @@ -53,6 +53,11 @@ bool SetFullscreen(bool fullscreen); /** + * Returns true if window runs in fullscreen mode. + */ + bool IsInFullscreen() const; + + /** * Switch between fullscreen and windowed mode. */ bool ToggleFullscreen(); Index: ps/trunk/source/ps/VideoMode.cpp =================================================================== --- ps/trunk/source/ps/VideoMode.cpp +++ ps/trunk/source/ps/VideoMode.cpp @@ -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 @@ -401,6 +401,11 @@ return SetFullscreen(!m_IsFullscreen); } +bool CVideoMode::IsInFullscreen() const +{ + return m_IsFullscreen; +} + void CVideoMode::UpdatePosition(int x, int y) { if (!m_IsFullscreen)