[AD] Code consistency across platforms

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


While comparing the code used on different platforms, I noticed that very similar tasks are sometime performed very differently on different platforms. In the case of OS X, this is sometimes necessary because of the use of Objective-C, but in other cases it appears to be just random or personal preference of whoever wrote the code. This isn't a big problem, but from a maintainability point of view it might be a good idea to compare how different operations are implemented on different platforms and try to "unify" the approach somewhat. This will also make it easier to implement things or fix bugs across different platforms by people who are not as familiar with some of them.

Another consistency point:
on OS X we have:
qzmouse.m
keybd.m
osxgl.m
system.m

On X11 the equivalent files are
xmousenu.c
xkeyboard.c
xdisplay.c / xsystem.c (both contain equivalent functions to osxgl.m, maybe also xglx_config.c)
xsystem.c

On Windows:
wmouse.c
wkeybdnu.c
wgl_disp.c/wnewwin.c
wnewsys.c

(Windows of course also has the D3D driver in d3d_disp.cpp)

And we have the generic UNIX files
umouse.c
ukeybd.c
usystem.c

That should probably also be synchronised a bit. It would be nice if functions for certain tasks can be found together in certain files on each platform, but the way some platforms work may make this hard (don't know, but I suppose it could). I don't think we actually need a platform prefix ("x", "w", "osx") for these files, since they're all in their own subdirectories, but it might be useful in some cases.

I would suggest the following "standard" filenames across platforms (with or without prefix):

mouse
keyboard
opengl (or plain gl)
system
cursor
joy (or joystick?)

Thoughts?

Also, there seem to a lot of old/unused files still around, for instance in the OS X port. Is it ok to remove these to get rid of some of the clutter?

Evert




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