I am having problems trying to read pixel data from the back buffer. The code I have is returning all 0’s in my pixel array. Here is a bit of my code.
First I initialize all my arrays
glDrawArrays(GL_QUADS,0, NUMSURF*4);
glReadBuffer(GL_BACK);
glReadPixels(0,0,viewport(3),viewport(4),GL_COLOR_INDEX,GL_UNSIGNED_BYTE,bits);
When I look at bits I am always getting 0’s
Any help would be great. I know that I am drawing correctly because when I swap the buffers after this I can see what I am trying to read into bits.
Thanks,
Brian