I’ve been trying to find what the opengl spec says about the state of texture units after rendering context switches, but I’m not having much luck.
Here’s the confusion:
suppose I create a window with a gl context and start rendering to it. i create texture #1 and bind it to texture unit 0. I draw a textured square.
then, I create a pbuffer. I call wglShareLists so that the pbuffer and window context share texture names. I create texture #2 and bind it to texture unit 0. I draw a textured square.
When I switch contexts from the pbuffer back to the window context, what is the state of texture unit 0 and what is bound to it? Is there anything bound? Is it texture #1? Is it texture #2? Is it undefined?
There’s reasons to think that it might be either of the 3 conditions… texture #1 (if texture unit states are maintained by the driver when rendering contexts are switched)… texture #2 (if all rendering contexts share the same texture unit state)… or undefined (if switching away from a rendering context makes no guarantees about what the texture unit states are when you return).
any ideas/experience/references to documentation anywhere?
thanks,
trey