PDA

View Full Version : glReadPixels from GL_FRONT fails right after Swap



Gaint_Robo
02-21-2012, 02:53 AM
0 down vote favorite
share [g+] share [fb] share [tw]


I have tried to read the front and back buffer with diffrent buffers. Back buffer before swap and front buffer after swap.

glReadBuffer(GL_BACK);
glReadPixels(0, 0, 1, 1, GL_BGRA, GL_UNSIGNED_BYTE, buffer_back);
SimpleGLContext::instance().swapBuffers();
glReadBuffer(GL_FRONT);
glReadPixels(0, 0, 1, 1, GL_BGRA, GL_UNSIGNED_BYTE, buffer_front);

Here buffer_back has the BGRA values correctly, but buffer_front is still giving null value. So please give me advice on that. Thanks in advance.