Jump to content
  • Advertisement
Sign in to follow this  
pupillo

glSwapBuffers

This topic is 3583 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

Who knows why glSwapBuffers takes as much as some milliSecs to run? What does it do exactly? I expected something like pointers exchange but I'm afraid it moves the content of the buffers. Am I right? Thanks

Share this post


Link to post
Share on other sites
Advertisement
glSwapBuffers will execute all pending commands, It might wait for vertical retrace. As for the swap itself, it's configurable but most probably something like a pointer exchange.

HTH.

Share this post


Link to post
Share on other sites
I omitted to say that my scene is totally empty, vertical sync is disabled, I'm using a direct rendering context and my code simply is:
while (1) { glXSwapBuffers(...); }
It can't be just an exchange...

Share this post


Link to post
Share on other sites
Unless you're shipping this application, don't bother. Profile when you have a real problem.
EDIT:
Quote:

I'm using a direct rendering context


As in single buffered rendering? If so why are you calling glXSwapBuffers?

Share this post


Link to post
Share on other sites
No, direct rendering means it bypasses the X server fluff and is hw accelerated.
With indirect rendering, you don't get hw accel.

Share this post


Link to post
Share on other sites
doubble buffered mode

GLint att[] = { GLX_RGBA, GLX_DEPTH_SIZE, 24, GLX_DOUBLEBUFFER, None };
...
vi = glXChooseVisual(dpy, 0, att);

I don't understend why glXSwapBuffers is so slow if hw acc. is enabled ! :S

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!