Re: [AD] Color depth in X version of Allegro

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


Michael Bukin <M.A.Bukin@xxxxxxxxxx> writes:
> gfx_driver->desc should be used only for printing it to the user. It 
> should not be used in any other way, IMHO.

I agree. Parsing strings is too ugly, plus liable to change if someone 
alters the wording of the driver message, or translates it to a different 
language.

> Currently there is no way to obtain information about nature of graphics 
> driver in X.  We can use id flags in BITMAP structure to identify bitmaps 
> that are emulating color depths, but I'm not sure how useful it will be.

Another option would be for this to be a flag in gfx_capabilities, but I'm 
not sure whether that is a good idea either. There are plenty of free bits 
at the moment, but we could quickly run out if each driver started putting 
specific information into it.

How about making several dummy graphics drivers, one for each mode? That is 
similar to how I handle the VESA stuff (banked, linear, etc): the code is 
mostly shared, but I have several driver structures all pointing at the same 
functions, and then the init functions return an error if they can't set the 
specific operating mode that this driver is intended for. This allows 
programs to check check gfx_driver->id, and also gives some mode control 
over the mode setting because if you request a specific mode, it will fail 
when the depths don't match (this could be quite useful when writing code 
that will look for the best possible depth, as it could try all depths first 
with the matching driver, then with the fast driver, and only fall back on 
autodetect if those fail).

I would be quite happy with however you prefer to do this, though.


--
Shawn Hargreaves - shawn@xxxxxxxxxx - http://www.talula.demon.co.uk/
"A binary is barely software: it's more like hardware on a floppy disk."



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