Index: ps/trunk/source/main.cpp =================================================================== --- ps/trunk/source/main.cpp +++ ps/trunk/source/main.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2019 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -79,6 +79,7 @@ #include "scriptinterface/ScriptEngine.h" #include "simulation2/Simulation2.h" #include "simulation2/system/TurnManager.h" +#include "soundmanager/ISoundManager.h" #if OS_UNIX #include // geteuid @@ -407,16 +408,10 @@ g_Console->Update(realTimeSinceLastFrame); ogl_WarnIfError(); - // 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(); + if (g_SoundManager) + g_SoundManager->IdleTask(); - PROFILE3("swap buffers"); - SDL_GL_SwapWindow(g_VideoMode.GetWindow()); - } - ogl_WarnIfError(); + Render(); g_Profiler.Frame(); Index: ps/trunk/source/ps/GameSetup/GameSetup.cpp =================================================================== --- ps/trunk/source/ps/GameSetup/GameSetup.cpp +++ ps/trunk/source/ps/GameSetup/GameSetup.cpp @@ -188,14 +188,21 @@ g_GUI->GetActiveGUI()->SendEventToAll("progress"); } - +void SwapBuffers() +{ + PROFILE3("swap buffers"); + SDL_GL_SwapWindow(g_VideoMode.GetWindow()); + ogl_WarnIfError(); +} void Render() { - PROFILE3("render"); + // Do not render if not focused while in fullscreen or minimised, + // as that triggers a difficult-to-reproduce crash on some graphic cards. + if (g_app_minimized || (!g_app_has_focus && g_VideoMode.IsInFullscreen())) + return; - if (g_SoundManager) - g_SoundManager->IdleTask(); + PROFILE3("render"); ogl_WarnIfError(); @@ -330,6 +337,8 @@ g_Profiler2.RecordGPUFrameEnd(); ogl_WarnIfError(); + + SwapBuffers(); } ErrorReactionInternal psDisplayError(const wchar_t* UNUSED(text), size_t UNUSED(flags))