VOGONS

Common searches


First post, by NY00123

User metadata
Rank Member
Rank
Member

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.

Attachments

  • Filename
    dosbox_bufferswap_20130224.diff
    File size
    879 Bytes
    Downloads
    209 downloads
    File comment
    glClear patch
    File license
    Fair use/fair dealing exception

Reply 1 of 5, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Busy you've been. Very interested in your sdl 2.0 port 😉

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 2 of 5, by NY00123

User metadata
Rank Member
Rank
Member
Dominus wrote:

Busy you've been. Very interested in your sdl 2.0 port 😉

Why, thank you. In that case I'd say that, if the "busy" word applies, then it does so to a preparation for the SDL 2.0 port more than actual coding.

Maybe it's good to mention that the patch here does *not* apply to the SDL 2.0 port, even though I have mentioned it and the flickering bug is more noticeable on that. Chances I'll simply update the SDL 2.0 patch to include that.

Reply 4 of 5, by NY00123

User metadata
Rank Member
Rank
Member
gulikoza wrote:

I don't see how moving glClear() down 10 lines would solve anything?

While I agree it seems technically minor, the new call to glClear() is actually getting stored in a display list to be executed later for each displayed frame.