diff --git a/backends/graphics3d/ios/ios-graphics3d.cpp b/backends/graphics3d/ios/ios-graphics3d.cpp index 0bcab86afd8..d35219a18e0 100644 --- a/backends/graphics3d/ios/ios-graphics3d.cpp +++ b/backends/graphics3d/ios/ios-graphics3d.cpp @@ -470,6 +470,17 @@ void iOSGraphics3dManager::hideOverlay() { delete _overlayBackground; _overlayBackground = nullptr; + + if (_surfaceRenderer) { + _surfaceRenderer->prepareState(); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); + _surfaceRenderer->restorePreviousState(); + updateScreen(); + _surfaceRenderer->prepareState(); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); + _surfaceRenderer->restorePreviousState(); + updateScreen(); + } } bool iOSGraphics3dManager::showMouse(bool visible) { diff --git a/backends/graphics3d/openglsdl/openglsdl-graphics3d.cpp b/backends/graphics3d/openglsdl/openglsdl-graphics3d.cpp index 75b1af9c754..81c53b3cf4b 100644 --- a/backends/graphics3d/openglsdl/openglsdl-graphics3d.cpp +++ b/backends/graphics3d/openglsdl/openglsdl-graphics3d.cpp @@ -714,6 +714,18 @@ void OpenGLSdlGraphics3dManager::hideOverlay() { delete _overlayBackground; _overlayBackground = nullptr; + + if (_surfaceRenderer) { + // If there is double buffering we need to redraw twice + _surfaceRenderer->prepareState(); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); + _surfaceRenderer->restorePreviousState(); + updateScreen(); + _surfaceRenderer->prepareState(); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); + _surfaceRenderer->restorePreviousState(); + updateScreen(); + } } void OpenGLSdlGraphics3dManager::copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) {