Re: [AD] Documentation update

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


On 2005-04-26, spoofer255@xxxxxxxxxx wrote:
> > On 2005-03-22, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
> > > > if (bitmap_color_depth(screen) == 8)
> > >
> > > shouldn't that be
> > > if (get_color_depth() == 8) ?
> 
> I don't think so. get_color_depth() will return current selected
> color depth. But this one doesn't have to be screen color depth,
> see my example:
> 
> set_color_depth(32);
> set_gfx_mode(GFX_SAFE, 320, 240, 0, 0);
> allegro_message("%d - %d", get_color_depth(), bitmap_color_depth(screen));
> set_color_depth(16);
> allegro_message("%d - %d", get_color_depth(), bitmap_color_depth(screen));

Well, you have just pointed out how broken Allegro's API is because
it has always preserved backwards compatibility. Whenever Allegro's
old API is gone for good you will enjoy a single call with an
included color depth.

In the meantime we have to flag your example as something users
should never do, and improve the documentation of set_color_depth()
to tell the user their next call should always be set_gfx_mode(). Or
just say that between set_color_depth() and the next successful
call to set_gfx_mode() graphic operations are undefined/invalid.

Whatever the case, more documentation changes.




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