I have the pbuffer working well
I have shaders working well
But I can’t for the life of me get it to render into the pbuffer while using a shader.
The rendering context on the pbuffer is different than the one the window normally uses.
I can use shading and pbuffers just fine if the shaders are attached to the window’s rendering context. I can not get them to attach to the pbuffer’s context though. Is it possible? It must be…
I’m so confused, I’m even willing to send my code if someone has the time.
I wasn’t used to programming with multiple rendering contexts.
The p-buffer has a context and there is the “regular context”, which just renders to the window normally. So, I was creating my shaders when in the regular context, and it should have been in the pbuffer’s context. Likewise, I wasn’t careful when reshaping the window, changing the display settings, etc.
So, a pbuffer context can have shaders, extensions, and other things, you just now have another state variable to consider…which context you are in. Just because the main window is using a depth test doesn’t mean that the pbuffer is, and shaders are also, it seems, not shared between contexts. Too bad Tha’d be a cool feature.
I guess you guys already know about that stuff, but it is just a thing I hadn’t considered, not hard once you know what is going on. Like too many quirky things in programming, no?
wglShareLists() shares not only display lists but shaders, textures, VBOs etc. as Daniel Wesslen mentioned. The docs in MSDN are just quite outdated. You still need to keep track of different states between the contexts though.
I don’t think there is a single place for wglShareLists as it is a Windows only call and does not exist in the main OpenGL docs. (And hence MS has not updated their docs since 1.1 days)
However, if you look in the VBO/ARB VP/FP and other specs, you will see reference to if the new object type is shared in the same way as display lists.