Re: [AD] messy allegro 5.0 stuff

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


David A. Capello <dacap@xxxxxxxxxx> wrote:

>My principal idea, is rename the routines and structures to simplify
>the portability and (mainly) the write of the code (with very-short
>names), is much better write:
>
>  al_bpp(al_screen());
>  al_mask(al_screen());
>  al_width();
>
>Earlier which this:
>
>  al_bitmap_color_depth(al_screen);
>  al_bitmap_mask_color(al_screen);
>  AL_SCREEN_W

readability is equally important. IMHO one must use common sense and name
frequently used funtions with small names and not so common ones with longer
and more descriptive names. then there's the need to avoid too much changes
so that learning the new API won't be hard.

>And we could have various standard-api-styles like:
>
>  #include "allegro/api/ver3x.h"   #include "allegro3.h"
>  #include "allegro/api/ver4.h"    #include "allegro4.h"
>  #include "allegro/api/ver5.h"    #include "allegro5.h"
>  #include "allegro/api/short.h"   #include "allegro6.h"
>
>This idea can be very-useful or *really-very-messy*.

Really messy, trust me. It's difficult to maintain and not a good idea.
People should use allegro 4.0 if they want compatibility.

>Common-return value for all routines?
>AL_OK, AL_ERROR, AL_ENOMEM, etc.
>
>if (al_begin_graphics(AL_AUTODETECT, 8, 320, 200, 0, 0) != AL_OK) {
>  al_error("Error setting graphics mode 320x200 8bpp\n%s\n",
al_get_error());
>  al_close();
>  return 1;
>}

this one i like.

>Other thing, maybe this will be useful for a lot of people:
>
>  al_get_input(AL_KEY_LEFT)
>  al_get_input(AL_MOUSE_LEFT)
>  al_get_input(AL_JOY_BUTTON_1)
>  etc.
>
>When I make a game, I have the problem to merge keyboard+joystick (+mouse)
>to one function to make the game `control-configurable'. And other thing,
>we can have some like:

merging the input subsystem is a good idea. it makes things simpler for the
programmer.

Sincerely Henrik Stokseth.
-----------------------------------------------------------------------
E-mail: hstokset@xxxxxxxxxx  Homepage: http://hstokset.n3.net





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