Hi guys,
I would like to know how to convert the content in frame buffer into a 2D array (pixel by pixel)?
e.g. consider the following code:
glBegin(GL_POLYGON);
glVertex3f (0.25, 0.25, 0.0);
glVertex3f (0.75, 0.25, 0.0);
glVertex3f (0.75, 0.75, 0.0);
glVertex3f (0.25, 0.75, 0.0);
glEnd();
The code above draw a rectangle on the screen,
I would like get the following:
000000000000000000000000000
000001111111111111111100000
000001111111111111111100000
000001111111111111111100000
000001111111111111111100000
000001111111111111111100000
000001111111111111111100000
000001111111111111111100000
000001111111111111111100000
000001111111111111111100000
000000000000000000000000000
Thanks.