PDA

View Full Version : Problem with pbuffer and CopyPixels



tkerwin
09-13-2004, 11:27 AM
I'm using a pbuffer for some off-screen rendering so I can store some intermediate results and reuse them in a later frame. I need both the color and depth buffers copied over to the main gl window.

Unfortunately, when I do this:

GLint v[4];
glGetIntegerv(GL_VIEWPORT, v);

wglMakeContextCurrentARB(myHDC, pHDC, mycontext);
glCopyPixels(v[0], v[1], v[2], v[3], GL_COLOR);
glCopyPixels(v[0], v[1], v[2], v[3], GL_DEPTH);
wglMakeCurrent( myHDC, mycontext);It crashes on the first CopyPixels in nvoglnt.dll
myHDC and mycontext are associated with the original gl buffer, while pHDC is the handle to the pbuffer display context.
I checked and the wglMakeContextCurrentARB call returns true, so I'm at a loss about what to try next.

This works fine:
1. Binding the pbuffer
2. Drawing scene
3. ReadPixels to a char array in memory
4. Binding original gl buffer
5. DrawPixels
but of course, this isn't what I want: it's pretty slow and doesn't really need pbuffers to get it working anyway.

Does someone out there have working code that does this kind of operation that they could give me or help me get pointed in the right direction? I'm running on a GeForce FX 5900 with the 61.77 drivers.

tkerwin
09-14-2004, 11:30 AM
After some more research (from this post (http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=get_topic;f=3;t=008594) ) and doing some tests for myself, I found that I get the crash in the drivers if I try to use copy pixels from a single or double buffered pbuffer to a double buffered normal opengl buffer.

I assume this is a driver bug since I don't know of anything in the spec that says I can't do this, but if anyone else has any insight, I would appreciate the input.