Sign in to follow this  

Problem porting SDL based app to MacOS X

This topic is 4036 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

I've developed a rather huge app which is based upon (among other libs) SDL. The same source code compiles under Windows in VC6 and under Linux in a command line environment. I wish to port this application to MacOS X and I'm running into some practical problems. I've got the application running on both a G4 and an Intel based MacOS X machine, but here are my issues: - I want to set up some items in the top bar menu because apparently Mac people want that. - I want to package the app into a nice .App package installer-thingy that user can just drag into their Applications folder (the way they are used to). Now, what I read constantly is "use XCode". I'm not using XCode because I havn't found an easy way to put my project into XCode, and would prefer to be able to do a "make publish" like I just do under Linux from the command line. My projects consists of a number of C++ files, header files, and a Makefile. The executable generated reads a number of PNG and TGA files that it needs to function, but that's essentially it. Can anyone help out with the menus and the packaging? Let me know if you need more information. :-) Thanks a lot in advance. Jakob See my profile for a link to the project if you're interested.

Share this post


Link to post
Share on other sites
Regarding the native MacOS X menus, I don't think SDL supports having your application accessing its internal MacOS X/Quartz window handles. At least when you look at the source code for SDL (both 1.2 and the still-in-development 1.3), you'll see the the SDL_GetWMinfo() for Quartz is commented out. But maybe you should try calling SDL_GetWMinfo() anyway, to see what it returns - maybe you're lucky and you'll get a window handle.

If you can manage to get a quartz window handle (in some way or another), you'll probably be able to tell it to get a menu by using standard MacOS X functions. If you're really dedicated you might want to hack your own version of SDL to do the job, but remember to release your changes under the LGPL :)

Alternatively you might be able to tell SDL to not use quartz but instead go for X11 (by setting the environment variable SDL_VIDEODRIVER to "x11"), which is more throughoutly supported. I guess you can add menus to X11 windows as well. (see http://tronche.com/gui/x/xlib/).
But I don't know whether it will get the right "MacOS X feel", and maybe it will confuse your users.

Keep in mind that SDL wasn't designed to do this kind of stuff... Are native dropdown menus really necesary? :)

Share this post


Link to post
Share on other sites
Can you slap on a cross-platform GUI lib to accomplish this?

Something like WxWidgets seems to sound exactly what you're looking for...though (obviously) I have no idea what it would take to integrate it with your existing codebase.

It'll run on PC/Linux and Mac

hth,

Share this post


Link to post
Share on other sites

This topic is 4036 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this