PBuffers and Rendercontexts

I´m working with PBuffers. Up to now I used the same rendercontext for all PBuffers. On my ATI R9800 card it even worked to share the same rendercontext for a 32bit framebuffer and a 64bit floating point pbuffer. I used “wglMakeContextCurrentARB”, since wglMakeCurrent() reported mismatching pixelformats. Now I tried the same code on a GF6800 card which again is reporting mismatching pixelformats, even with wglMakeContextCurrentARB.

wglMakeContextCurrentARB also has some undocumented constraints. For instance, if you used it to switch to a pbuffer, you HAVE to use it again, to switch back to the framebuffer. wglMakeCurrent() will fail.

It seems, I´m forced to support more than one rendering context in my application, but I´m a bit unsure how. I´m thinking about forcing all contexts being creating to share their lists. This helps me very much when it comes to manage textures, VBO´s, vertex/fragment programs/shaders, display lists and so on…
Can I make this assumption? Or are there pitfalls than I do not forsee here? It may be a wrong question in this forum, but is this design also possible on GLX? What are your experiences when trying to abstract Pbuffers in an OOP fashioned way?

thx for your ideas

Are you using wglShareLists ?

Using wglMakeCurrent is sufficient. I don’t use wglMakeContextCurrentARB and every works fine.

You can check this . This is a PBuffer test rendering a scene in a texture for example.

Originally posted by skynet:
What are your experiences when trying to abstract Pbuffers in an OOP fashioned way?

Not the best. I was writing some support classes that would implement support for floating point pbuffers w/ RTT for ATI and NVIDIA cards on Windows and Linux. It is possible but it gets messy. I wish the libSDL project would start supporting off-screen rendering surfaces or just different contexts. If I had more time to spare I would help them out myself. But maybe there are good reasons why they’ve decided to not support them.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.