Re: [AD] No need for END_OF_MAIN (Windows) |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: Re: [AD] No need for END_OF_MAIN (Windows)
- From: Chris <chris.kcat@xxxxxxxxxx>
- Date: Sat, 14 May 2005 15:25:20 -0700
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=CjhkhZuGKw7MwcVGysLriw0L/sO96MJw6Iq4euKr8oJv/BluvrTVWqiqXzz5rad/JmYyuAIgRAHKSI7VCLivt7q37lOWQjZiwmEuG4CCDqjhBTmHJs9i0keEYLoxw39CMM4volP8YqV3zyD0pRj5QcqGCBAyEwyh71t4CB7iToY=
Evert Glebbeek wrote:
I would be very surprised if that doesn't give problems somewhere some
how. Does it really work well if you compile and link a multi-file
project? Does this mean a WinMain is added to each Allegro sourcefile that
ends up in the library or DLL?
What about, at least for 4.3+, you have the user place a define in the
source file that contains main. So, it'd be like:
#define ALLEGRO_MAIN
#include <allegro.h>
...
int main()
{
return 0;
}
That way, Allegro would only define it once and the user wouldn't have
to put END_OF_MAIN() or ALLEGRO_NO_MAGIC_MAIN. If they wanted to make
their own WinMain or whatever, they just don't define it.
I'd just be sure to make a huge warning about OSX users.. that the real
main function should be something else (say, user_main), and the
user-created main should call soemthing like: al_osx_startup(user_main);
when they want to start using allegro stuff, which would throw the
current thread into device polling and run user_main in a seperate one.
Evil, yeah, but that's only applicable when the user wants to handle
main themselves. It's more evil for OSX to require input gathering to be
done on the main thread.
Of course, we could always push the use of the polling functions in such
a case...?