Thanks for replies
I am trying to use glReadPixels to read 300 X 300 pixels from the front buffer(i am not sure if that is correct) and I want to see them on my monitor using glDrawPixels. but I get a consol mesage says:
GLUT: Warning in d:\Documents and Settings…\Desktop…\Release(my application name).exe: The following is a new check for GLUT 3.0; update your co
de.
GLUT: Fatal Error in d:\Documents and Settings…\Desktop…(application name)\Release???.exe: redisplay needed for window 1, but no display callback.
Press any key to continue . . .
Can any one tell me what is the problem with using both of them and how to read a block of pixels from the scene and save them together with other blocks and finally display them all together in one image?
It is a vital task for me. I appreciate your help so much.
[b]
int width_p = 300;
int height_p = 300;
float* pixels_ptr = new float[3*(width_p)*(height_p)];
int main(int argc, char** argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(1024, 768);
glutCreateWindow("?????????");
initRendering();
glutKeyboardFunc(handleKeypress);
glutReshapeFunc(handleResize);
glRasterPos2i(0,0);
glReadBuffer(GL_FRONT);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadPixels(0,0,width_p,hight_p,GL_RGB,GLUT_DOUBLE, pixels_ptr);
glDrawPixels(width_p,hight_p,GL_RGB,GLUT_DOUBLE, pixels_ptr);
//glCopyPixels(0,0, width_p, height_p,GL_COLOR);
glutPostRedisplay();
glutMainLoop();
return 0;
}[/b]