What glutswapbuffers actually did?

Jabutey Ng picture Jabutey Ng · Jun 13, 2012 · Viewed 8.9k times · Source

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 means?the back buffer now points to null?

Answer

datenwolf picture datenwolf · Jun 13, 2012

The contents of the back buffer then become undefined.

What does the last sentence means?

It does mean, that after the swap the contents of the back buffer may be everything. It may be the front buffer, random data, a picture of you on vacation, whatever. It's not defined and you should make no assumptions whatsoever about it.