Rob Jenkins (robj++at++sgi.com)
Thu, 10 Dec 1998 02:11:30 -0800
I recognise the above :-) It's simple and works well on some machines
but doesn't really do ehough to work on all machines. The issue is two
fold: man glXChooseFBConfigSGIX describes the way the list of potential
matches is returned and ordered, if you lok at the rules for sorting the
returned list the 2nd consideration is:
2. larger total number of RGBA color components (GLX_RED_BITS,
GLX_GREEN_BITS, GLX_BLUE_BITS, and GLX_ALPHA_BITS) that
have higher number of bits,
In other words, the list is sorted deepest to shallowest RGB. Now, if
you look at the man page for glXMakeCurrent it tells you that:
BadAlloc may be generated if the server has delayed allocation of
ancillary buffers until glXMakeCurrent is called, only to find
that it has insufficient resources to complete the allocation.
So, with the simple search appoach above, if you're on a machine with
enough frame buffer to have RGBA 12 visuals available, the first match
you find will be RGBA12, and if you check, could well have huge
accumulation buffers etc that you don't need. So, this matches your
simple test, you stop searching but presto, it's too big to make a
pbuffer with.
You'd need to play around but some extra things you could add to try and
make it work in all cases are:
o decide what your bare minimum config needs to be, eg RGB >= 5, A = 0,
depth > 1 ( there is no depth = 1, putting 1 means you get the biggest
available ).
o decide on things you'd like to do without, eg accum buffer = 0,
stencil = 0. Be careful not to hardwire for cases where you only
consider the case where they are = 0, search for a match with no accum
buffer but also deal with the case where the only match does have some
accum bits.
o consider traversing the list > once, either search until you have the
minimal match or maybe try glxMakeCurrent but handle the failure with
badalloc and search for a smaller match.
To get a feel for the right approach, look at the output of findvis on
various machines and see the kind range you have to cope with ( bear in
mind that display resolution and channel size will effect the list
return by findvis ).
Hope this helps,
Cheers
Rob
> Thanks
> Ruediger
>
> --
>
> =======================================================================
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
-- ________________________________________________________________ Rob Jenkins Silicon Graphics mailto:robj++at++sgi.com
This archive was generated by hypermail 2.0b2 on Thu Dec 10 1998 - 02:24:35 PST