[AD] alternate entry point for allegro programs |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
Is the END_OF_MAIN stuff and changing the user's main() function to _mangled_main() really necessary? Couldn't all the stuff that Allegro's main or _WinMain does just be taken care of by a function that is called by the user, rather than by a function that hijacks the program's entry point? As far as I can tell the only thing that the END_OF_MAIN stuff does that couldn't be done by a normal function is allowing the user to use main() rather than WinMain() on Windows... and while that's nice, I'm not sure it's something a game library should bother with, and even if Allegro must do that, it seems like that functionality could be separated from all the code that happens in _WinMain or main.
My problem is this: I am trying to create an OCaml wrapper for Allegro. If I compile a native code binary linked to Allegro, the entry point of the program is going to be with my OCaml code, not with Allegro. So there's no way to get to Allegro's main() function.
On the other hand, if anyone knows a way I CAN get to Allegro's main() function without the program starting there, I'd love to hear it.
Thanks. Mike Benfield
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |