c++openglglut

What glutSwapBuffers actually did?


Does the front buffer pointer now points to the back buffer? Or the front buffer content was updated by the back buffer's? If that is the case, whole block of the content is updated or only the changed content is updated?

The description of glutSwapBuffers on opengl.org is

Performs a buffer swap on the layer in use for the current window. Specifically, glutSwapBuffers promotes the contents of the back buffer of the layer in use of the current window to become the contents of the front buffer. The contents of the back buffer then become undefined.

What does the last sentence mean? The back buffer now points to null?


Solution

  • This means, that glut does not guarantee that after back buffer becomes front, that buffer that is now back will be something meaningfull, like if you suppose it to contain that information, that previously was in "old" front buffer. I suppose, it's made so, because otherwise you would need third buffer to swap buffers in that way, which is unacceptable in high-perfomance 3D