differences between glXGetConfig & glXGetFBConfigs - Xwindows

This is a discussion on differences between glXGetConfig & glXGetFBConfigs - Xwindows ; Hi guys It might be a trivial-stupid question but I am trying to understand the differences between glXGetConfig & glXGetFBConfigs. Basically I looked at the code for glxinfo.c in the OpenGL/XWindow book and they use glXGetConfig but when i look ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: differences between glXGetConfig & glXGetFBConfigs

  1. differences between glXGetConfig & glXGetFBConfigs

    Hi guys
    It might be a trivial-stupid question but I am trying to understand the
    differences between glXGetConfig & glXGetFBConfigs. Basically I looked
    at the code for glxinfo.c in the OpenGL/XWindow book and they use
    glXGetConfig but when i look at the glx spec they seem to only talk
    about glXGetFBConfigs so wonder if it is just a matter of the book
    being a bit old? or something else I don't know about.
    For example in the book they call visualList = XGetVisualInfo( ... )
    first to have a list of all the visuals and then use glXGetConfig( ...
    ) to query information on a specific visual from the visualList.
    In the other hand, glXGetFBConfigs(...) seems to return a list of
    GLXFBConfig and querying the content of an attribute in a config can be
    done by using glXGetFBConfigAttrib(...). The second solution seems a
    bit more elegant so I wonder if the specs have changed over the years
    so now they encourage to use the second method rather than the first.
    Thanks to let me know what is the best/more recent way of getting that
    to work.

    cheers, mark


  2. Re: differences between glXGetConfig & glXGetFBConfigs

    mast2as@yahoo.com wrote:
    > Hi guys
    > It might be a trivial-stupid question but I am trying to understand the
    > differences between glXGetConfig & glXGetFBConfigs. Basically I looked
    > at the code for glxinfo.c in the OpenGL/XWindow book and they use
    > glXGetConfig but when i look at the glx spec they seem to only talk
    > about glXGetFBConfigs so wonder if it is just a matter of the book
    > being a bit old? or something else I don't know about.
    > For example in the book they call visualList = XGetVisualInfo( ... )
    > first to have a list of all the visuals and then use glXGetConfig( ...
    > ) to query information on a specific visual from the visualList.
    > In the other hand, glXGetFBConfigs(...) seems to return a list of
    > GLXFBConfig and querying the content of an attribute in a config can be
    > done by using glXGetFBConfigAttrib(...). The second solution seems a
    > bit more elegant so I wonder if the specs have changed over the years
    > so now they encourage to use the second method rather than the first.
    > Thanks to let me know what is the best/more recent way of getting that
    > to work.
    >
    > cheers, mark
    >


    Unlike the Blue book (OGL reference) & the Red book (OGL programming),
    the Green book (OGL programming for X Windows) was not updated when
    changes to OpenGL & GLX took place -- as far as I know, the Green book
    only has a single edition.

    The Green book was written when OpenGL was at version 1.1 and GLX was at
    version 1.2. The FBConfigs concept wasn't added to GLX until GLX 1.3
    (although some implementations could have supported it earlier if they
    supported the GLX_SGIX_fbconfig extension). The GLX subroutines for
    FBConfigs were intended to replace the ones that existed for X visuals
    so they are the ones that are prominent in the GLX specification. Of
    course, the GLX subroutines for X visuals have to be supported for
    compatibility purposes.

    I think that the glXChooseFBConfig subroutine has a better search
    criteria than the glXChooseVisual subroutine has. However, a program
    that uses a XGetVisualInfo; glXGetConfig loop mechanism won't be
    improved by using a glXGetFBConfigs; glXGetFBConfigAttrib loop mechanism
    -- it would merely be more up-to-date (and the newer loop only works if
    GLX is 1.3 or later).

    There are some situations where a program would want to use FBConfigs
    instead of X visuals:
    a) if Pbuffers are desired
    b) if multisampling is desired (GLX 1.4)(X visuals could be used if the
    GLX_SGIS_multisample extension is supported)
    c) the program cares about GLX_TRANSPARENT_TYPE and/or
    GLX_TRANSPARENT_*_VALUE (X visuals could be used if the
    GLX_EXT_visual_info extension is supported).


    Jim Lahue

  3. Re: differences between glXGetConfig & glXGetFBConfigs

    Thank you for your help Jim.

    For future reference I have found a version of the gears program in the
    Mesa source tree that uses GLX fuctions instead of ChooseVisual etc...
    (glxgears_fbconfig.c i think).

    I am still exploring the world of GLX so I am sure I will have more
    question in the next few days. Thanks again -mark

    > I think that the glXChooseFBConfig subroutine has a better search
    > criteria than the glXChooseVisual subroutine has. However, a program
    > that uses a XGetVisualInfo; glXGetConfig loop mechanism won't be
    > improved by using a glXGetFBConfigs; glXGetFBConfigAttrib loop mechanism
    > -- it would merely be more up-to-date (and the newer loop only works if
    > GLX is 1.3 or later).
    > > Jim Lahue



  4. Re: differences between glXGetConfig & glXGetFBConfigs

    > For future reference I have found a version of the gears program in the
    > Mesa source tree that uses GLX fuctions instead of ChooseVisual etc...
    > (glxgears_fbconfig.c i think).


    i meant the "FB" version of the functions of course, not GLX functions


+ Reply to Thread