I want to find out whether a pixel is the background pixel.
code is as below:
glClearColor(1.0,1.0,1.0,1.0);
glClear(GL_COLOR_BUFFER_BIT);
…
glReadBuffer(GL_FRONT_LEFT);
glPixelStorei(GL_UNPACK_ALIGNMENT,1);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadPixels(0,0,ImgWidth,ImgHeight,GL_RGB,GL_UNSIGNED_BYTE,pixmap);
then, when I read the R,G,B value from pixmap, they always are not 255, but ‘\0’.
what’s the problem? is that problem of pixel format?
thanks a lot!