View Full Version : PBuffers created okay but not working

Chris Weaver
02-15-2010, 03:23 AM

I trying to do offscreen rendering to a PBuffer (as a fallback when FBO's are not supported) as described in my Offscreen rendering problem (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=270285#Post2702 85) post.

My code is basically the same as in the Code Sampler (http://www.codesampler.com/oglsrc/oglsrc_7.htm) source for creating and setting up the pbuffer in the standard way (I first create a hidden window to find the pixel format since this may need to run on a server).

Everything works on relatively up-to-date graphics cards but testing on my old GeForce4 MX440 the pbuffer gets created with no errors and rendering goes ahead. However, when trying to grab the resulting render (immediately after rendering) with glReadPixels() and again, as in my original post when trying to render directly to the hidden window, all I get is a copy of the desktop.

How is it possible that the pbuffer is created and being used yet glReadPixels still only managed to grab the desktop image? I know why this was happening when not using a buffer because of pixel ownership but I don't understand it not working when using the buffer. Can a pbuffer still fail the pixel ownership test?

This gives me another problem; I now can't fallback again to DIB rendering because the pbuffer did not give an error when being created!