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; glGetIntegerv(GL_VIEWPORT, v); wglMakeContextCurrentARB(myHDC, pHDC, mycontext); glCopyPixels(v, v, v, v, GL_COLOR); glCopyPixels(v, v, v, v, 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:
- Binding the pbuffer
- Drawing scene
- ReadPixels to a char array in memory
- Binding original gl buffer
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.