[AD] Global variables vs. Access functions

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


Hi people.

I was looking at both 4.3 and 4.9 versions, learning about the new API
to plan the next step in Allegro.pas.

I want to do a proposal about global variables. The old API has some
of them (key, screen, font, key_shifts, etc.). When I wrote
Allegro.pas I had a lot of problems with them and some should be
translated onto "pointers to pointers of something". The hardest ones
were the global arrays (key, fix_cos, fix_sin...). I don't know if
other ports (python, D...) had same problems but if the new API will
use access functions instead of global variables (you know "int
get_key_shift (void);" and "void set_key_shift (int);" instead of
"extern int key_shift;") they will be easer to port and I think it
will add more stability to the library (check bounds, values and other
possible problems).

I see that the current "new API" don't use global variables (or I
didn't see them). Did you discussed this issue yet? Is there a
decision about this?

I hope you understood my proposal.

Guillermo "Ñuño" Martínez




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