Re: [AD] Magic main in Windows |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
At 06:06 AM 2/08/2004, you wrote:
On Sunday 01 August 2004 18:30, Daniel Schlyder wrote:
> No idea. SDL also hides WinMain() but doesn't require the use of a macro.
I
> don't remember how they do it; maybe worth examining.
Looks like SDL just pulls a #defines SDL_main main in it's main include
file and calls that.
Not sure if that means that you can't use your own WinMain though... I
guess it doesn't but how they worked around that I don't know.
the allegro docs say this:
The Windows, Unix and MacOS X versions require you to write END_OF_MAIN()
after your main() function. This is used to magically turn an ISO C style
main() into a Windows style WinMain(), or by the Unix code to grab a copy
of your argv[] parameter, or by the MacOS X code to shell the user main()
inside a Cocoa application.
personally i use:
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR
lpCmdLine, int nCmdShow)
instead of int main(int argc, char *argv[])
as i need a copy of the hInstance, maybe allegro needed it at some point.