Re: [AD] Allegro 5.0 graphic routines, alpha 3

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


Robin Burrows wrote:

[snip varargs]

> args should always be in same order and defaults used
> if param not passed. I've been told in #allegro that
> va doesn't give num of args and a terminating param
> would need to be passed, if so this makes it slightly
> more cumbersome (adding 0/NULL to end, or
> AL_DEPTH|AL_WIDTH|AL_HEIGHT flags), any ideas?

I don't like the idea of varargs for this, as most of the parameters
for set_gfx_mode (or create_display, whatever) are not optional
anyway, and there's no way of checking for valid parameter types. I
agree with Lorenzo that the version with set_config_int for 
each parameter is too long, but I also see the beauty of using the
config ints. (If only because afterwards you can read them out again
with get_config_int...)

How about using both:

create_display(width, height, mode, refresh, all_other_params)

internally calls

set_config_int("gfx/width", width);
set_config_int("gfx/height", height);
etc

and a different version, without parameters

create_display_noparam()     /* think of better name */

assumes that all these variables have been set in advance with
set_config_int. This way it's possible to call one function to create
a display, the config variables are used, and it's even possible to
set them by hand and set the display without repeating things.  If
that is thought too complicated (or duplicated) I prefer the version
where all the parameters are passed to 1 function, like it was
before. This has the advantage of being short, and you cannot forget
to set parameters accidently. (this is something that tends to happen
to me with openGL, I always forget to set 1 vital setting resulting in
a black screen)

Hein Zelle

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



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