link19
03-04-2004, 11:50 AM
Im reading the pixels with glReadPixels and the bitmap is all gray...
Any idea why?
dorbie
03-04-2004, 10:38 PM
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
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.