Re: [AD] user data

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


> Yes, but I heard people a while ago saying that Allegro could make
> use of it in some way (such a field is only useful if one is 100%
> sure Allegro will never use it). Can't actually remember when and
> what about though.

As soon as you use video bitmaps (including the screen) under Windows (and
before long under QNX, once video bitmaps are implemented).
Excerpt from src/win/wddraw.h:

/* bitmap definitions */
typedef struct BMP_EXTRA_INFO {
   LPDIRECTDRAWSURFACE2 surf;
   struct BMP_EXTRA_INFO *next;
   struct BMP_EXTRA_INFO *prev;
   int flags;
   int lock_nesting;
} BMP_EXTRA_INFO;

#define BMP_EXTRA(bmp) ((BMP_EXTRA_INFO *)(bmp->extra))

> BITMAPs and DIALOGs were the main ones, but it would be useful for
> every structure that you can get from an Allegro API call (and as
> such you need a way to get data from an Allegro type, so you can't
> make a new structure that contains the Allegro structure (or derive
> from it in C++)).

But you can always make a structure that contains a pointer to an Allegro
structure, no ? IMHO that's more sensible: as your functions are basically
wrappers around Allegro's functions, your structures are wrappers around
Allegro's structures.

--
Eric Botcazou
ebotcazou@xxxxxxxxxx



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