Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Using glReadPixels in win2k

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 davidko   Members   

122
Like
Likes
Like

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?
      
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...

#2 zedzeek   Members   

528
Like
Likes
Like

Posted 20 September 2001 - 10:54 AM

try doing a glFlush() or glFinish() first




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.