Also you can by-pass SDL_main on those situations where you don’t need
main() at all (e.g. in a library) or you can guarantee the standard
main() will do (e.g. *nix or MinGW). Note how this is relevant only at
link time, and only if you include the SDL_main library.
2013/6/10, Jonathan Dearborn :> SDL_main exists because some OSes require a special main() entry point for
graphical programs (e.g. WinMain()). SDL_main makes it so that you can
write a single entry point that is cross-platform. It has nothing to do
with initialization of SDL.Jonny D
On Mon, Jun 10, 2013 at 9:45 AM, Alex Barry <alex.barry at gmail.com> wrote:
Sorry, I’m trying to sort out exactly what you are asking.
Are you trying to sort out the relationship of SDL2.dll and SDL2_main.dll
?If you are trying to load up SDL functionality from a DLL, it would be
wise for your main program to handle SDL_init and SDL_quit, and the DLL
just makes the assumption that this has been done. If that can’t be
done,
most applications that I’ve used that use DLL files as plugins typically
search for a startup() and shutdown() functions (with varying naming
conventions), in which case, you could call SDL_init() and SDL_quit()
inside those functions in your DLL file.Sorry if I’m way off, I’m trying to understand the context of your
question, and having a bit of trouble with that.On Mon, Jun 10, 2013 at 9:37 AM, john skaller < skaller at users.sourceforge.net> wrote:
What exactly does SDL do with main, and why is this in the library
in this form?I’m at a loss to understand why we don’t just have
two functionsSDL_start SDL_finish
which encapsulate the prolog and epilog code.
[the old method can be provided in a separate header]My application code lives in a DLL which is loaded
under program control. You can’t fiddle it by macro’ing main.
What am I losing?–
john skaller
skaller at users.sourceforge.net
http://felix-lang.org
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org