From ffdcc16af513555773b19020f7bef3c1a7cf1c46 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Sun, 2 Jun 2019 19:40:59 +0000 Subject: [PATCH] Always clear drawing area. Should fix certain linux instalations that use triple buffering Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4229 --- src/gui/sdlmain.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp index 24807125..b0635487 100644 --- a/src/gui/sdlmain.cpp +++ b/src/gui/sdlmain.cpp @@ -1004,6 +1004,10 @@ void GFX_EndUpdate( const Bit16u *changedLines ) { break; #if C_OPENGL case SCREEN_OPENGL: + // Clear drawing area. Some drivers (on Linux) have more than 2 buffers and the screen might + // be dirty because of other programs. + glClearColor (0.0, 0.0, 0.0, 1.0); + glClear(GL_COLOR_BUFFER_BIT); if (sdl.opengl.pixel_buffer_object) { glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_EXT); glBindTexture(GL_TEXTURE_2D, sdl.opengl.texture);