Porting a C++ game to iPhone

As far as I can tell you must write your program in Objective C, is this correct? From my limited research Objective C is built on C, and replaces C++. Would the easiest way to port a C++ game to run on the iPhone be to simply convert the code to pure C? Are there any conversion utilities to convert C++ to Objective C or aid in this process?

Is there any way to compile or run C++ on the iPhone? Perhaps by sticking it in a library or DLL?

C++ should compile and run with no problem. You'll need to write at least a small amount of Objective-C or Objective-C++ glue code to work with the system and set stuff up, but other than that, there's no reason at all you can't use C++ for everything else.

I mean, if iPhone SDL would be released and we could create games using that SDL, I doubt Apple would let us distribute our games through the AppStore because we didn't use the official library (OpenGL ES?) they have chosen for the iPhone?

I doubt that SDL software drawing routines would be fast enough on the phone. You'll almost certainly still have to use OpenGL for graphics, which implies learning OpenGL ES for the iPhone port. SDL would just be for getting a window on the screen and handling events... and given the events are completely different to what you'd get with a keyboard and mouse, the event handling code won't be common, so... just getting a window on the screen. At that point, why bother?

I agree with OSC there, I don't see how the main parts of SDL would be at all useful for games on the iPhone. SDL_image and some of the other add ons could be useful, but only if you were trying to make a cross platform (including windows) code base. And if you're making a game that could share the same source at such a low level for both a windows version and an iPhone version, you're going to have a hard time whatever you chose.

If you want to make a game easy to port later use OpenGL (doesn't have to be OpenGL ES). For all your rendering, including UI, and OpenAL for your audio. Also keep a few key iPhone specific things in mind, like your app could be told to quit at any time, so you need to be able to save quick and restore state just as quick. Also battery usage is important so keep your CPU usage down and of course the user input methods are very unique and need to be designed for.

I agree with OSC and Reubert. I just don't see how SDL on iPhone would be able to add any advantage to simply programming directly on iPhone. It's going to have to use OpenGL ES anyway, and software rendering is going to be hard to make happen with the limited resources. Not saying it won't happen, but I'm skeptical of how useful or advantageous it would be.