glReadPixels from GL_FRONT fails right after Swap

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.