Sign in to follow this  

Porting an SDL project from Win to Mac

This topic is 4490 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I am working on porting Jooleem to OS X, not with a great degree of success so far. I don't have any previous experience with OS X, since my last Apple was a IIc. Anyway, since the game was developed with portability in mind, I got it to compile in XCode in less than an hour. Got to love SDL :). It runs beatifully. I have a some issues, though, that maybe you can help me clear up: 1. I have created a package using PackageMaker, and it installs nicely on my machine, and the game works. However, when a user tried to install the package, the game refuses to run. He says there is just a blank window, with no error message. I suspect this might have something to do with him not having the SDL frameworks installed. In Windows, I just copy the required DLLs to the executable's folder. What is the mac equivalent? 2. The exectable created is over 12 MB in size. The windows executable is about 400 KB. What am I doing wrong? 3. The application icon looks like it only has 1-bit alpha, although the source PNG has an 8-bit alpha channel. I know this is a problem with the WIN32 version of SDL_WM_SetIcon, but I didn't find a reference to it on OS X. Is there a platform specific way to override SDL_WM_SetIcon and make my icon render nicely?

Share this post


Link to post
Share on other sites
Quote:
Original post by Peregrin
1. I have created a package using PackageMaker, and it installs nicely on my machine, and the game works. However, when a user tried to install the package, the game refuses to run. He says there is just a blank window, with no error message. I suspect this might have something to do with him not having the SDL frameworks installed. In Windows, I just copy the required DLLs to the executable's folder. What is the mac equivalent?
Embedding the SDL framework into your application bundle. See here.

Also, I got burned in the past when I distributed my game with an installer. People don't like it; it seems that on Mac, what they prefer is something that runs directly from the disc image. As you can package your entire app as a single bundle, it's then just a question of dragging and dropping that bundle from the disc image into the Applications folder if they want to keep it.

Quote:
2. The exectable created is over 12 MB in size. The windows executable is about 400 KB. What am I doing wrong?
Is that the actual binary, or the .app? If it's the binary, I'm not sure, perhaps you're building a debug version or something. If it's the .app, open it up and have a look at what's inside it to see what's taking up all the space.

Share this post


Link to post
Share on other sites
If you're building with something like XCode, that's how it'll be coming out by default. A .app file isn't a binary - it's basically just a directory which OSX treats in a special way due to the .app on the end of the name. Packaging the game as a bundle means putting all your resources and stuff inside that folder somewhere; you should then be able to reference them by building paths that treat the .app file as a regular directory.

However, I'm afraid I've never really done it myself - I mentioned that I got burned on a project, well, I've not actually done another Mac project since [smile] Got advised as to what I should look into for next time back then, but haven't tried it out myself yet. Sorry I can't be more help.

Share this post


Link to post
Share on other sites
I didn't realise that the .app file contained all the game's resources. That explains why it is so large.

What is the path for the resource file in the bundle, relative to the executable?

Share this post


Link to post
Share on other sites
Sign in to follow this