GRAPHICS3D: Clear screen while hiding overlay

This commit is contained in:
Le Philousophe committed 2023-11-26 16:12:14 +01:00
1 parent eae8491722
commit 0ea1b5aef6
2 files changed
+23

No files matched your search

@@ -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) {
@@ -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) {