Re: [AD] Allegro5 and colors

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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday 08 September 2002 18:54, Bob wrote:
> However, if we want to support depths larger than 32 bpp, we can't
> pass that value as a 32-bit int (obviously).

typedef char al_color[8];
al_color al_makecol(BITMAP*, int, int, int); // rgb, obviously :-)
al_color al_makecol_yuv(BITMAP*, int, int, int);
al_color al_makecol_cmyk(BITMAP*, int, int, int, int);
// ...

The idea being that al_color can hold anything (we make it big enough). 
The makecol() functions are stateless in that they must operate on a 
BITMAP. Maybe that's bad. But anyway, the idea still holds.

> An other alternative is to have the current color as a state, much
> like OpenGL:
[snip]

Please don't do this :-)
A major consideration is that this will cause a lot of extra work in a 
multithreaded environment, since each drawing operation will require a 
mutex lock and color set operation.

Bye for now,
- -- 
Laurence Withers,  lwithers@xxxxxxxxxx
(GnuPG 04A646EA) http://www.lwithers.demon.co.uk/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9e7lNUdhclgSmRuoRApdzAJ9QtWbaEGwB/6pkEQsFc+QCTN0RxQCfSCYx
V2FULvhGXQFuO/BjFF0fBW8=
=I5fo
-----END PGP SIGNATURE-----



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