tags:

views:

339

answers:

2

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?

+2  A: 

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.

I would use FBOs in a heartbeat but the targeted graphic card only supports pbuffers... Platform is Windows (MingW, MSYS environment).
Kenji Baheux
+1  A: 

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.

Kenji Baheux
Good link, thanks
Ray2k