View Full Version : glReadPixels read the front buffer or the back buffer?

09-16-2004, 07:16 AM
the defination of glReadPixels says it read from the frame buffer, however, it does not say is the frame buffer the front buffer (which is already showed on the screen)or the back buffer (which is going to be shown the next time step).

Does anybody knows which buffer (front or back) is the glReadPixels read pixels from?

Thanks very much in advance

09-16-2004, 07:31 AM
glReadBuffer will let you choose.

09-16-2004, 09:52 AM
Usualy you draw stuff, then read it & then swapbuffers, so that buffer you just operated becomes front buffer. So logical it turns out to be backbuffer.

09-16-2004, 10:15 AM
The default read buffer is the back buffer when using double buffering, and the front buffer when using single buffering. So with double buffering, you read before swapping buffer.

Or, as gmeed said, you can also select the read buffer with glReadBuffer.