PDA

View Full Version : wglChoosePixelFormatARB returns 0



jwatte
04-16-2004, 04:36 PM
We use pbuffers for offscreen rendering at times.

When we first create our window, it's in windowed mode, and we choose and set a pixel format for the window. Then we choose a pixel format for a pbuffer, and create the pbuffer. This works.

The user can then "go fullscreen" which means that we call ChangeDisplaySettings(), and then call wglChoosePixelFormatARB() again to determine pbuffer support. We pass it the DC from the original window (which we retain -- we cannot re-create the context because there are other embedded windows in the same window that we don't control).

At this point, or any point thereafter, wglChoosePixelFormatARB() returns 0 formats, and a return code of 0. Any attempt to create a pbuffer fails, returning a NULL pbuffer DC.

This is on Radeon 9700 Pro / Windows XP SP1, although it happens on other cards, too.

My theory is that the driver thinks that, because I've set a pixel format on the DC, I can't choose one from that point on. However, that doesn't seem right, because you can't create a pbuffer until you have a pixel format, so choosing pixel formats must be possible even after setting them (even though you can only set pixel format once on a given DC).

tho
04-19-2004, 05:32 AM
Hi,

We also need to go fullscreen with pbuffers.

It looks like it does not append on nvidia cards but it fails on my Radeon 9600.

I isolated the problem in a minimal application with glut :
http://thomasbesson.free.fr/wglChoosePixelFormatARB.cpp <a href="http://thomasbesson.free.fr/wglChoosePixelFormatARB.zip" target="_blank">
http://thomasbesson.free.fr/wglChoosePixelFormatARB.zip</a> (vc6 src + bin) (http://thomasbesson.free.fr/wglChoosePixelFormatARB.zip)
You will have to change display resolution manually to make it append.

Did you solve the problem ? found a workaround ?
Please keep me in touch if you found anything

regards,
Thomas.