[AD] Platform specific functions in A5 [was Re: Windows Addition for Message Parsing]

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


On 8 Oct 2008, at 13:19, Elias Zacarias wrote:
I think you kinda go offtopìc.

Not if we're discussing adopting your change in Allegro 5.
It's a clean new API and we have the chance to design things in a platform neutral way now, if we can.

Even when the reason of the
implementation was being able to read multiple mice, the PURPOSE of
the FUNCTION I created (and I'm suggesting) is to enhance the
flexibility of Allegro on Windows.

Yes, but at the cost of platform portability. In a group where many people are on different platforms than Windows, that's something to keep in mind. We add that functionality to the Windows port. Ok, fine. But what makes Windows so special that we add it there? Why can't we have it on other platforms too? And if we do, are we going to have completely non-compatible implementations on those other platforms? So before going down that route, stop and consider if there isn't a way to do it that services all platforms (well, *nix/X11, Mac OS X and Windows anyway). There might not be, but I think the question needs to be asked.

And btw, by eliminating platform-specific functions you remove support
for platform-specific features and platform-specific issues, so I
guess they are needed in order to extend its functionality.

But if that functionality cannot be provided on other platforms, you lose portability. And again, that's a concern. Personally, I don't care about Windows - I don't use it and never intend to use it again for anything serious. However, if I make a game (or anything) with Allegro, part (a large part?) of my target audience will be on Windows, so it has to be easy to port things over. Ideally as simple as recompiling things on the other platform - but if I make extensive use of platform specific functions that becomes harder. At some point, you don't care and you just say "sorry, only works on such and so platform" and that's fine, but one of the points in using Allegro is that it should make it easier to port an application developed on Linux to Windows or OS X or vice versa. So before adding platform specific functions, consider whether you can add them in a way that doesn't break platform independence.

One way to address the issue is to implement platform-neutral support for problems that otherwise need to be solved in platform specific ways (like multiple mice on one system).

Another "solution" is to expose platform specific functions on all platforms but have them fail when they are not supported. That of course doesn't help if a user decides that a failure of said function means the program cannot be used at all, but at least it means you won't get compilation errors. I think the ALLEGRO_D3D macro works like that at the moment?

I would like to stay on topic anyway.

Well, these points are relevant to the discussion if tangent to your original post. I've modified the subject heading on this message to indicate the shift.

Evert



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