SDL: Do not allow toggle fullscreen for backends which can lose opengl context used for 3d games. (#2514)

This commit is contained in:
Paweł Kołodziejski 2020-10-13 20:27:58 +02:00 committed by GitHub
parent 495eb1b370
commit 59ba9cb715
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 16 additions and 7 deletions

View file

@ -123,8 +123,10 @@ bool SdlGraphics3dManager::notifyEvent(const Common::Event &event) {
}
void SdlGraphics3dManager::toggleFullScreen() {
if (!g_system->hasFeature(OSystem::kFeatureFullscreenMode))
if (!g_system->hasFeature(OSystem::kFeatureFullscreenMode) ||
(!g_system->hasFeature(OSystem::kFeatureFullscreenToggleKeepsContext) && g_system->hasFeature(OSystem::kFeatureOpenGLForGame))) {
return;
}
setFeatureState(OSystem::kFeatureFullscreenMode, !getFeatureState(OSystem::kFeatureFullscreenMode));
}