Re: [AD] New mode selector, or get_gfx_mode_list(), broken [djgpp, possibly others]

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


On 18 Sep 2001, Laurence Withers <lwithers@xxxxxxxxxx> wrote:
> 
> BTW, I really don't like the interface to get_gfx_mode_list(). If I need
> to poke at it, would anybody mind if I rewrote it? (to return a linked
> list).

I just don't like it returning through a global.  It should be like
the bitmap interface.

   GFX_MODE_LIST *list;

   list = get_gfx_mode_list(GFX_FOO);
   if (list) {
      /* work with list */
      destroy_gfx_mode_list(list);
   }

If it is really necessary to know if the call failed or not
supported, an optional parameter:

   list = get_gfx_mode_list(GFX_FOO, &error);

I also think an array is the right choice here, rather than a linked
list, but I'm not sure why.



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