PDA

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



s.hu
09-16-2004, 08: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

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

M/\dm/\n
09-16-2004, 10: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.

Bob
09-16-2004, 11: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.