Re: [AD] font vtable patch

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


> ... and we won't be able to remove/rename internals during a stable
> branch's lifetime, but I think that's fine.  There shouldn't be any
> alignment issues, right?  All in all, a very nice solution, at
> least, if you don't hate the preprocessor :-)

Yes, maybe is this a real drawback.
We could then use sort of a middle solution (a la COM): run-time linking
with a global interface, like:
/* in allegint.h */
  struct ALLEGRO_INTERNALS {
     int _textmode;
     ...
  };

/* user program */
struct ALLEGRO_INTERNALS *allegint;
allegint = get_allegro_internals();
if (!allegint)
   /* no internals available */

if (*allegint->_textmode < 0)
      /* render as transparent */
   else
      /* render as opaque */

This solution is safer and more flexible: it's up to the user to define (or
not) his own macro:
#define ALLEGINT(symbol)  *allegint->##symbol

Moreover, we could break the global interface into smaller parts:
get_allegro_internals("graphics"), get_allegro_internals("sound"),
get_allegro_internals("font").

--
Eric Botcazou
ebotcazou@xxxxxxxxxx



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