glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
//
// draw the polygon using glBegin(GL_POLYGON), etc. etc.
//
int size = screenwidth * screenheight*3;
unsigned char *pixels = new unsigned char[size];
glReadPixels(0, 0, screenwidth, screenheight,
GL_RGB, GL_UNSIGNED_BYTE, pixels);
I don''t usually make people read my code before I search the web for possible answers, but I''m somewhat stumped...and feel pretty dumb since I know there''s a really easy solution to this...
Using glReadPixels in win2k
Has anyone out there had problems using glReadPixels? Somehow, it''s only outputting the background color.
Can someone tell me if there''s something wrong with the code?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement