[Xcb] how to use xcb_glx_get_fb_configs_property_list?

Barton C Massey bart at cs.pdx.edu
Sun Dec 23 00:18:59 PST 2007

In message <20071222113015.7mt0me0mm8s44ocg at webmail.brandeis.edu> you wrote:
> Quoting Barton C Massey <bart at cs.pdx.edu>:
> > It looks like the get_fb_configs_reply should be passed to
> > get_fb_configs_property_list to actually extract the
> > property list data.  The properties seem to just be of type
> > uint32_t, so you should be able to just say something
> > generic like
> >
> >    uint32_t *props = xcb_glx_get_fb_configs_property_list(reply);
> >    uint32_t n = xcb_glx_get_fb_configs_property_list_length(reply);
> >    uint32_t i;
> >    for (i = 0; i < n; i++)
> >        process(props[i]);
> >
> > Actually, I'm not so sure that properties aren't supposed to
> > be xcb_glx_bool32_t.  Also, I don't see any obvious way to
> > construct an initial iterator for the properties---there's
> > an end iterator, but no obvious initial or next iterator.
> > Maybe somebody could look at the GLX spec and see that
> > everything is good here and I'm just confused?
> I'm on vacation and don't have access to my linux box.  This looks  
> vaguely familiar and there should be a list of attributes in the  
> protocol xml (look for something like RED_SIZE or whatever).  The  
> protocol is on opengl.org "encode1.3.ps" I believe in the doc section.  
>   Right now we get all fb configs, we need a utility function that  
> sorts through them like glXChooseFBConfig or whatever that function  
> is.  Look at the wire protocol I listed above it should help you out.

The protocol doc helped, thanks.  GetFBConfig is described
on page 29-30 of

It looks like the description given in the XML is highly
incomplete.  This is probably because the return value is
the usual GL mess.

Basically, the result of the request is a list of groups of
name-value pairs.  The number of groups and the (constant)
number of elements per group is given.  Then follow the
elements, each a 32-bit name followed by a 32-bit value.
The names probably need symbolic constants generated for
them---I couldn't find any pre-existing ones in the XML
anywhere.  The interpretation (type) of the value depends on
the name.

If somebody wants to take finishing this out as a coding
challenge, that would be great.  We need to auto-generate an
outer iterator over groups, an inner iterator over elements,
symbolic names for the elements, and appropriate type
conversions for the values. Having done so, the utility
functions for searching this stuff actually look pretty

In the meantime, one can kludge around it all by just
walking the list of 32-bit values and doing needed
interpretation oneself.  Not very fun, though.



More information about the Xcb mailing list