Using SDL, CodeWarrior, and MacOS Classic

(This could be well documented, but being a real man, I don’t read the
docs…so I hope, when this post shows up in Google’s libsdl archive, that
it saves someone the several hours I just wasted being a dumbass.

BE SURE to use the SDL_main object when you link, and redefine your main()
to be SDL_main! If you don’t, SDL throws up (and takes the system with it)
when you try to handle events.

This is made less obvious by the fact that using SIOUX before you handle
an event will make everything work fine. As soon as I built my program
with the printf() calls commented out, the whole system blew up, and I
spent forever looking at the pieces. :slight_smile:

Once I did this, everything worked like a champ (god, I’m always impressed
at how quickly SDL-based games can hop platforms!) …

Now, I’m not a Mac expert by any stretch of the imagination, so I have to
ask earnestly: how much of this code in the SDL_main object could safely
make it into SDL_Init()'s platform-specific sections? Is it even worth
doing that (after all, it was my dumb mistake to not use the object in
the first place)?

–ryan.

The only thing that one would be able to remove is the stdio file
redirection code, but in reality that can’t be removed because we have
an option in the dialog for turning it on/off. Besides that, this code
must run before the actual main method if it is going handle
command-line arguments. Try holding down the command key on startup to
see what I am talking about…

-DOn Wednesday, February 27, 2002, at 02:19 AM, Ryan C. Gordon wrote:

Now, I’m not a Mac expert by any stretch of the imagination, so I have
to
ask earnestly: how much of this code in the SDL_main object could safely
make it into SDL_Init()'s platform-specific sections? Is it even worth
doing that (after all, it was my dumb mistake to not use the object in
the first place)?