SDL double buffering not working in Linux

Started by
1 comment, last by Null and Void 15 years, 9 months ago
For the life of me, I can't figure out how to get double buffering to work in Linux. I am using SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); before SDL_SetVideoMode, but double buffering doesn't seem to be on. If it do glClear(GL_COLOR_BUFFER_BIT) before rendering, I get terrible flicker (there's flicker anyway, but less noticeable without this). If I put a large empty loop after the clear, it will show the blank screen for a while before rendering for a split second and then goes back to the blank screen for the next frame, so that is the basis of my assumption that double buffering is not working. Oh, and I'm using OpenGL. Any tips? I don't particularly need glClear (I was just testing something), but the flicker needs to be fixed somehow.
Advertisement
Nevermind, I'm stupid. It was an "optimization" that was leading me to think that double buffering wasn't on (sometimes it wasn't drawing the screen, even when it was being cleared).

However, it's still tearing. I tried this:

SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1);

But it doesn't seem to help.
It sounds like v-sync is not being enabled for whatever reason. Are you running your program fullscreen? That might help. Otherwise, there may be a setting in your 3D drivers for v-sync; I know there is in the NVidia drivers ("Sync to VBlank").

This topic is closed to new replies.

Advertisement