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 8 of 8

Thread: PFD_SUPPORT_OPENGL vs WGL_SUPPORT_OPENGL_ARB

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2012
    Posts
    4

    PFD_SUPPORT_OPENGL vs WGL_SUPPORT_OPENGL_ARB

    Hello.

    Anyone know why the method DescribePixelFormat() returns the pixel format does not support OpenGL (PFD_SUPPORT_OPENGL=false) while the ARB extension through wglGetPixelFormatAttribivARB() method returns the same pixel format supports OpenGL (WGL_SUPPORT_OPENGL_ARB=true)?

    I find a suitable pixel format that supports openGL with wglChoosePixelFormatARB() function and when informed of their characteristics to the user by DescribePixelFormat() function, returns that does not support OpenGL.

    is that correct?

    Thanks.

  2. #2
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,136

    Re: PFD_SUPPORT_OPENGL vs WGL_SUPPORT_OPENGL_ARB

    Quote Originally Posted by WGL_ARB_pixel_format
    ...Additionally this interface allows pixel formats to be supported which have attributes that cannot be represented using the standard pixel format functions, i.e. DescribePixelFormat, DescribeLayerPlane, ChoosePixelFormat, SetPixelFormat, and GetPixelFormat.
    The specification gives an answer to your question quite obviously.

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2012
    Posts
    4

    Re: PFD_SUPPORT_OPENGL vs WGL_SUPPORT_OPENGL_ARB

    I understand that new features can not be understood by older methods.

    But if both attributes have the same meaning (opengl support), why not return the same value?

    Are you saying that these two attributes are not equivalent?

    Sorry if it's obvious, but do not quite understand

    Thanks again.

  4. #4
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,136

    Re: PFD_SUPPORT_OPENGL vs WGL_SUPPORT_OPENGL_ARB

    Just use wglGetPixelFormatAttribivARB to query attributes, and read WGL_SUPPORT_OPENGL_ARB.

  5. #5
    Intern Contributor
    Join Date
    Sep 2004
    Posts
    77

    Re: PFD_SUPPORT_OPENGL vs WGL_SUPPORT_OPENGL_ARB

    DescribePixelFormat() returns informations for ALL pixel formats, not just the OpenGL supported once. That includes printer formats and device independent (DRAW_TO_BITMAP) pixel formats. Some of these formats just support the Mircosoft Generic OpenGL software implementation, and some don't support OpenGL at all.

    The extension on the other hand, are implemented via the OpenGL driver of your graphic adapter, and thus only know their own capabilities.

  6. #6
    Junior Member Newbie
    Join Date
    Apr 2012
    Posts
    4

    Re: PFD_SUPPORT_OPENGL vs WGL_SUPPORT_OPENGL_ARB

    OK, but in this case, I select the pixel format number 34 returned by wglChoosePixelFormatARB() (I want a pixel format that supports multisample):

    int iAttributes[] = { WGL_DRAW_TO_WINDOW_ARB,GL_TRUE,
    WGL_SUPPORT_OPENGL_ARB,GL_TRUE,
    WGL_ACCELERATION_ARB,WGL_FULL_ACCELERATION_ARB,
    WGL_COLOR_BITS_ARB,24,
    WGL_ALPHA_BITS_ARB,8,
    WGL_DEPTH_BITS_ARB,16,
    WGL_STENCIL_BITS_ARB,8,
    WGL_DOUBLE_BUFFER_ARB,GL_TRUE,
    WGL_SAMPLE_BUFFERS_ARB,GL_TRUE,
    WGL_SAMPLES_ARB, 4 , // Check For 4x Multisampling
    0,0};

    valid = wglChoosePixelFormatARB(hDC,iAttributes,fAttribute s,nMaxPixelFormats,pixelFormat,&numFormats);


    So DescribePixelFormat(), for the index 34, returns the PFD_SUPPORT_OPENGL bit off.

    And wglGetPixelFormatAttribivARB(), for the index 34, returns the attribute WGL_SUPPORT_OPENGL_ARB true.

    All other parameters in both functions are equivalent.

  7. #7
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,136

    Re: PFD_SUPPORT_OPENGL vs WGL_SUPPORT_OPENGL_ARB

    ..And after setting that pixel format (ID=34), can you draw using OpenGL?

  8. #8
    Junior Member Newbie
    Join Date
    Apr 2012
    Posts
    4

    Re: PFD_SUPPORT_OPENGL vs WGL_SUPPORT_OPENGL_ARB

    Yes, everything works perfectly.

    The "problem" is the user was seeing on a dialog box that the program did not support OpenGL, when it was not true. And that confused me. Ignoring this detail, everything is perfect.

    I've corrected the problem by using wglGetPixelFormatAttribivARB when available

    Thanks for the help.

Posting Permissions

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