Jump to content
  • Advertisement
Sign in to follow this  
Sydian

SDL double buffering not working in Linux

This topic is 3699 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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").

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!