mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-25 05:34:27 +00:00
SDL: Do not allow toggle fullscreen for backends which can lose opengl context used for 3d games. (#2514)
This commit is contained in:
parent
495eb1b370
commit
59ba9cb715
@ -94,6 +94,9 @@ bool OpenGLGraphicsManager::hasFeature(OSystem::Feature f) const {
|
||||
case OSystem::kFeatureAspectRatioCorrection:
|
||||
case OSystem::kFeatureCursorPalette:
|
||||
case OSystem::kFeatureFilteringMode:
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
case OSystem::kFeatureFullscreenToggleKeepsContext:
|
||||
#endif
|
||||
case OSystem::kFeatureStretchMode:
|
||||
return true;
|
||||
|
||||
|
@ -205,6 +205,9 @@ bool OpenGLSdlGraphicsManager::hasFeature(OSystem::Feature f) const {
|
||||
switch (f) {
|
||||
case OSystem::kFeatureFullscreenMode:
|
||||
case OSystem::kFeatureIconifyWindow:
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
case OSystem::kFeatureFullscreenToggleKeepsContext:
|
||||
#endif
|
||||
return true;
|
||||
|
||||
default:
|
||||
|
@ -348,8 +348,10 @@ bool SdlGraphicsManager::notifyEvent(const Common::Event &event) {
|
||||
}
|
||||
|
||||
void SdlGraphicsManager::toggleFullScreen() {
|
||||
if (!g_system->hasFeature(OSystem::kFeatureFullscreenMode))
|
||||
if (!g_system->hasFeature(OSystem::kFeatureFullscreenMode) ||
|
||||
(!g_system->hasFeature(OSystem::kFeatureFullscreenToggleKeepsContext) && g_system->hasFeature(OSystem::kFeatureOpenGLForGame))) {
|
||||
return;
|
||||
}
|
||||
|
||||
beginGFXTransaction();
|
||||
setFeatureState(OSystem::kFeatureFullscreenMode, !getFeatureState(OSystem::kFeatureFullscreenMode));
|
||||
|
@ -222,6 +222,7 @@ bool SurfaceSdlGraphicsManager::hasFeature(OSystem::Feature f) const {
|
||||
(f == OSystem::kFeatureAspectRatioCorrection) ||
|
||||
(f == OSystem::kFeatureFilteringMode) ||
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
(f == OSystem::kFeatureFullscreenToggleKeepsContext) ||
|
||||
(f == OSystem::kFeatureStretchMode) ||
|
||||
#endif
|
||||
(f == OSystem::kFeatureCursorPalette) ||
|
||||
|
@ -78,7 +78,7 @@ OpenGLSdlGraphics3dManager::~OpenGLSdlGraphics3dManager() {
|
||||
bool OpenGLSdlGraphics3dManager::hasFeature(OSystem::Feature f) const {
|
||||
return
|
||||
(f == OSystem::kFeatureFullscreenMode) ||
|
||||
(f == OSystem::kFeatureOpenGL) ||
|
||||
(f == OSystem::kFeatureOpenGLForGame) ||
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
(f == OSystem::kFeatureFullscreenToggleKeepsContext) ||
|
||||
#endif
|
||||
|
@ -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));
|
||||
}
|
||||
|
@ -76,9 +76,7 @@ SurfaceSdlGraphics3dManager::~SurfaceSdlGraphics3dManager() {
|
||||
|
||||
bool SurfaceSdlGraphics3dManager::hasFeature(OSystem::Feature f) const {
|
||||
return
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
(f == OSystem::kFeatureFullscreenToggleKeepsContext) ||
|
||||
#endif
|
||||
(f == OSystem::kFeatureAspectRatioCorrection) ||
|
||||
(f == OSystem::kFeatureFullscreenMode);
|
||||
}
|
||||
|
@ -375,9 +375,9 @@ public:
|
||||
|
||||
/**
|
||||
* This feature flag can be used to check if hardware accelerated
|
||||
* OpenGl is supported.
|
||||
* OpenGL is supported and can be used for 3D game rendering.
|
||||
*/
|
||||
kFeatureOpenGL,
|
||||
kFeatureOpenGLForGame,
|
||||
|
||||
/**
|
||||
* If supported, this feature flag can be used to check if
|
||||
|
Loading…
x
Reference in New Issue
Block a user