Sign in to follow this  
irmains_2

what is buffer and glutSwapBuffers?

Recommended Posts

"Buffer" here refers to the region of (video) memory where the computer renders image frames.

With double-buffering, two such buffers are used, the front buffer and the back buffer. The front buffer is the one that contains the frame you are currently seeing. The back buffer is the one in which the computer is currently busy rendering the next frame. When that rendering is done, the two buffers are swapped, instantly updating the image you see to be the next-now-current frame. The computer then again moves on to rendering a new frame in what is now its current back buffer.

This technique ensures that you only ever see fully rendered frames rather than "work in progress".

glutSwapBuffers() is the GLUT function that instructs the computer that you are done with the current frame and the buffers should be swapped so that that frame be displayed and so that you can begin working on the next.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this