Jump to content

  • Log In with Google      Sign In   
  • Create Account


Using glReadPixels in win2k


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   -  Reputation: 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...

Sponsor:

#2 zedzeek   Members   -  Reputation: 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.



PARTNERS