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);
Using glReadPixels in win2k
1 reply to this topic
Members - Reputation: 122
Posted 20 September 2001 - 07:12 AM
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?
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...