Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: wglChoosePixelFormatARB returns 0

  1. #1
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,411

    wglChoosePixelFormatARB returns 0

    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).
    "If you can't afford to do something right,
    you'd better make sure you can afford to do it wrong!"

  2. #2
    Junior Member Newbie
    Join Date
    Apr 2004
    Location
    Belgium
    Posts
    10

    Re: wglChoosePixelFormatARB returns 0

    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)
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •