Jump to content
  • Advertisement
Sign in to follow this  
chen884488shi

About glReadPixels

This topic is 3633 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In my program I want to use a picture as a texture. I load it like this: ///////////////////////////////////////////////////// data=(void*)pData; format = GL_BGRA; type = GL_HALF_FLOAT_NV; glDrawPixels(image_w, image_h, format, type, data);//image_w=4096,image_h=4096 ///////////////////////////////////////////////////////////// In fact,I can only see part of the picture.Most of the data out of screen. after render it ,I want to read the result data. I use glReadPixels(0, 0, image_w, 4096,GL_LUMINANCE, GL_UNSIGNED_BYTE,data1); But I can only get the data on the screen that I can see ,the other part of picture is black. How can it get all the data that I load? thanks.

Share this post


Link to post
Share on other sites
Advertisement
OpenGL only guarantees correct values of visible pixels. That means, pixels outside the window, or pixels hidden by other windows, are not guaranteed to have correct values. You cannot get around that, other than rendering to an offscreen buffer. Check out pbuffer or FBO (frame buffer objects).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!