• Advertisement
Sign in to follow this  

glReadPixels and overlapping window/dialogs

This topic is 3312 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

Hello, I remember that a few years ago I experiences troubles with the glReadPixels command when my rendering window was covered by other windows. In that situation I couldn't read correct values in the depth buffer. I now am in a similar situation but don't have the problem anymore: the read values are always correct, even when the rendering area is covered. The only situation when this doesn't work is when my rendering window is minimized. My question now is: what is different now that the glReadPixels command also works when the window is covered? I am still running Windows XP. I vaguely remember reading that Windows XP uses one single buffer for various applications, which causes the bad glReadPixels values with overlapping windows.

Share this post


Link to post
Share on other sites
Advertisement
As far as OpenGL is concerned, nothing is different. What you are experiencing now, and what you experienced then, is and was undefined behavior. OpenGL does not define the content of pixels the rendering context does not own. So you could get something wrong (as you did before) or you could get what you expect (as you do now). Whatever is happening, the result is not something you should rely on. In a strict sense, your code is wrong if you read pixels you don't own and expect something from it.

Share this post


Link to post
Share on other sites
if u have nvidia card it was possible to disable/enable the option that the window has its own memory. thus will work in the above case if enabled, but like others say its not guaranttedd

Share this post


Link to post
Share on other sites
Thank you for the replies!

I am actually using the FBO functionality on cards that support it, but for all others, I use the traditional rendering to the window. I was just curious why it worked on all 3 computers that I tested (Window XP). I also read somewhere that from Windows Vista on, the problem due to occlusion won't exist anymore. Can someone confirm this?

Share this post


Link to post
Share on other sites
Again, as far as OpenGL is concerned, it doesn't work. Even if you think it does, it doesn't. That's what undefined behavior is; you may or may not get what you expect, and if you get what you expect, it is not because it works. And there's no exception for Vista in the specification.

Share this post


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

  • Advertisement