Question

I have been scouring the web for a code sample that shows how to use pbuffer with GLUT but I could not find anything...

I am puzzled with the context switching between pbuffer and the rendering window. I guess that I will have to use glutSetWindow to switch between the two rendering surface but I am not too sure about the details.

Can someone explain me how to use a pbuffer with GLUT?

Was it helpful?

Solution

The short answer is that there's no good way of doing it.

The longer answer is that pbuffers are not cross-platform, so you necessarily have to use platform-specific APIs to access them. How you switch between rendering surfaces depends on your platform; on Windows you'd use wglMakeCurrent() and the like.

The meta-answer is that you should avoid pbuffers if at all possible - FBOs provide similar functionality but without this kind of problem, and with better performance too.

OTHER TIPS

Mike F's answer lead me to a good explanation from ATI about the pbuffers. Thanks!

I did not find any mention of GLUT functions to switch context, only wgl* functions. I must have misunderstood the purpose of glutSetWindow.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top