View Full Version : pbuffers: to share or not to share

06-29-2004, 04:12 PM
my needs are simple. I want to save and restore the screen on windows. I create a pbuffer, and then use the "make current read" extension (wglMakeContextCurrentARB) along with glCopyPixels to copy stuff to and from the pbuffer. It works great -- mostly. This is mostly to target the radeon line. We have 2 test apps. One is a viewer for mechanical parts that we distribute to customers as a starting point for their apps. The other is a little standalone test that we use as a regression test. On most radeons both the viewer and regression test work. On 9000 and 7500 the viewer works, but the regression test fails. On rage 128 pro, the viewer doesn't work.

I create the pbuffer as such (where ogldata contains everything associated with the main frame buffer...
int properties[] = {0};
pbuffer = wglCreatePbufferARB( ogldata->hDC, format, w, h, properties );
hDC = wglGetPbufferDCARB(pbuffer);
hGLRC = wglCreateContext( hDC );
On radeon 7500, when I replace the last line with
hGLRC = ogldata->hGLRC
(to share context between frame buffer and pbuffer), it fixes the regression test, but breaks the viewer.

To review:
a) my pixelformat is guaranteed to be the same;
b) my use of the pbuffer is solely for the glCopyPixels to and from.
Should I be sharing context or not? Have I run into an ATI bug?