I am currently experiencing some annoying results with glReadPixels. I would like to know if i am doing something wrong/forbidden.
I develop under Windows, but I guess this is OS-independent.
I have 2 OpenGL windows, with distinct contexts which share lists.
Windows are double buffered.
I can’t use FBO to support prehistoric OpenGL cards. :’(
Window1 is displayed (Window2 hidden), and i would like to render in the Windows2 back buffer, and read it.
But glReadPixels always returns the window1 back buffer whereas the objects are rendered into the window2 back buffer!
In the glReadPixels sdk page, a note specifies :
“Values for pixels that lie outside the window connected to the current GL context are undefined.”
In my process, the current GL context is connected to the hidden window2, but i get window1 pixels… O.o
I wonder if glReadPixels can read pixels in another window than the current one ?
Do I miss something?