glReadPixels

Im reading the pixels with glReadPixels and the bitmap is all gray…

Any idea why?

Need more info than this.

I have had the same problem and it was due to read from the wrong buffer. If you are running with doublebuffering I found the following scheme to work

display(){
…renderToBuffer…
glReadBuffer( GL_BACK );

//w_ is width of window, same for h_
glReadPixels( 0 , 0 , w_ , h_ , GL_RGB ,GL_UNSIGNED_BYTE , (GLvoid*) pixels);

glutSwapBuffers();
}
//display end
my problem was that i made the grab after I swapped buffers which just gave me a blank picture.

Niels