Re: [AD] al_update_display_region

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Fri, 2009-02-27 at 22:27 +0100, Milan Mimica wrote:
> Elias Pschernig wrote:
> > 
> > Well, I get the below. ex_expose has this for some reason:
> > 
> > al_set_new_display_format(ALLEGRO_PIXEL_FORMAT_ANY_32_NO_ALPHA);
> > 
> > If that is wrong, what should it be instead?
> > ALLEGRO_PIXEL_FORMAT_ANY_NO_ALPHA? ALLEGRO_PIXEL_FORMAT_ANY_32?
> > ALLEGRO_PIXEL_FORMAT_ANY_24? Or should I just remove the call
> > completely?
> > 
> > I guess it would be better to have a requested format only fail if
> > absolutely necessary. In this case, all the 24 bit formats with alpha 0
> > are what the user intended - they are RGBX after all, just GLX doesn't
> > report that "X" separately as bits.
> 
> 24 bit and 0 alpha is not RGBX, that's RGB. ALLEGRO_PIXEL_FORMAT_ANY_NO_ALPHA 
> covers both. I don't know why ex_expose had that call.
> 

The problem really is the X bits. If you select a GLX/WGL buffer which
has red/green/blue to 8 bits and alpha to 0 bits, you don't know if
there are 0 or 8 X bits. So failing selection because guessing either is
wrong.

I committed a fix for it (simply setting the color size to SUGGEST for
ALLEGRO_PIXEL_FORMAT_32_NO_ALPHA). Thinking about it, it likely would be
better to somehow treat each format in WGL/GLX with r/g/b=8 and a=0 as
both a 24-bit and 32-bit format, but seemed harder to do that.

-- 
Elias Pschernig <elias@xxxxxxxxxx>





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/