PDA

View Full Version : Pbuffer's own render context



Obli
09-11-2003, 08:12 AM
I am just wondering... is it really necessary to have a different rendering context for each pbuffer? Isn't changing render context expensive?

I heard I can share the same render context if the pixelformat is (obviously enough) the same, can somebody confirm that?

roffe
09-12-2003, 12:08 AM
Originally posted by Obli:

I heard I can share the same render context if the pixelformat is (obviously enough) the same, can somebody confirm that?

Yes, that is correct. When you've created the pbuffer and want to switch to it just use the rendering context of your window/other pbuffer in the wglMakeCurrent call. Be aware though that the call will fail if the pixelformats aren't compatible.

Obli
09-12-2003, 11:05 PM
Uhm, this is another reason to go back and update my window-management api so I can detect when the pixel format is the same.

By the way, I have some hints which are telling me that context switching on pbuffers may be optimized.

Someone here got a benchmark ready to go? I will have to code it my own if not.