Re: [AD] Small problem with driver removals

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


Evert Glebbeek wrote:

> No, but there may be a problem with it anyway: I've compiled code that 
> explicitly used GFX_DIRECTX (apparently because the author didn't trust 
> GFX_AUTODETECT to pick it automatically) that otherwise compiled fine. 
> Defining the GFX_DIRECTX driver ID on all platforms would not have cought 
> that problem and made the code fail at run time. That is much harder to 
> debug (I'd probably just have given up in that case).

I encountered lots of similar program's, and indeed it is practical
that the compiler throws an error at you and refuses to build the
program. On the other hand, provided allegro always defines all
driver constants, it really is the responsibility of the programmer to
not use the GFX_DIRECTX constants directly if they want their program
to be portable. And, if they don't throw a proper warning (failed to
set gfx mode, optionally add DIRECTX) that's bad programming from
their side.

Allegro is supposed to be a multi-platform library that makes it easy
to write portable program's. I'm not sure how far we should go in
forcing people to write portably. I do think that not defining all
driver constants might hamper people who validly try to write a
program that _is_ multiplatform but needs (all) the separate driver
constants. Like the NES emulator.

I'd choose for always defining the constants, and emphasizing in the
docs that a) you should really always verify if setting the graphics
mode worked with a proper error message, and b) they should REALLY use
gfx autodetect, and provide a config file if they want a preference
for a different driver than the one that's automatically selected.

Hein Zelle

>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-< 
 Unix is user friendly. It's just very particular about who 
 it's friends are.

 Hein Zelle                     hein@xxxxxxxxxx
	                        http://www.icce.rug.nl/~hein
>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-<




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