Render text informing of ongoing shutdown (#696)

This commit is contained in:
Alexander Bock
2018-08-24 03:15:55 -06:00
parent 63561d685f
commit 67dd887e52
3 changed files with 24 additions and 0 deletions

View File

@@ -760,6 +760,11 @@ void OpenSpaceEngine::loadSingleAsset(const std::string& assetPath) {
void OpenSpaceEngine::deinitialize() {
LTRACE("OpenSpaceEngine::deinitialize(begin)");
// We want to render an image informing the user that we are shutting down
_renderEngine->renderEndscreen();
_engine->_windowWrapper->swapBuffer();
for (const std::function<void()>& func : _engine->_moduleCallbacks.deinitializeGL) {
func();
}
@@ -1235,6 +1240,7 @@ void OpenSpaceEngine::postSynchronizationPreDraw() {
if (_shutdown.inShutdown) {
if (_shutdown.timer <= 0.f) {
_windowWrapper->terminate();
return;
}
_shutdown.timer -= static_cast<float>(_windowWrapper->averageDeltaTime());
}