First post, by NY00123
Hey,
This day I have toggled on triple-buffering in the driver for OpenGL, mainly for testing something. [If you're asking, that's NVidia and a GNU/Linux desktop.]
With that in mind and Vertical VSync forced, I have seen a few glitches within DOSBox:
- I'm not sure it's the same thing reported here: Bricks Game - Unusual flicker/ CAPS lock interchange, but I've seen that border issue more often now, I believe. It's also, let's say, more specific in the way it looks.
- Less often I could see old flickering contents. Think that you change from a text mode with no aspect correction on a widescreen to graphics mode with aspect=true, hence the screen gets smaller. Then you may see the textual contents flicker, like they're stored in one of two buffers and not erased.
- It's actually easier to see this when this recent SDL2 modification is applied: An adaptation to SDL 2.0 (Alpha-level Android build attached). However, I could see it even within vanilla DOSBox (as coming from Ubuntu 12.04).
Now, what I have done to solve this is apply the following change.
Vanilla DOSBox behavior:
- When a video mode change is desired, at some point glClear is called, then the buffers get swapped and afterwards glClear is called again.
New behavior:
- Call glClear before a frame is shown on screen (for each frame).
While the former approach often works well, it can fail as we can see. A patch is attached with the minor modification.