
Hey,
this is not a proper Wiki page because I don't think the iPhone port will be officially supported for a while. Anyway, if anyone wants to port a C++ game to the iPhone, here's the steps as far as I remember:
One-time:
• install boost as shown on the GettingStartedOnOsx wiki page
• check out Gosu from SVN, build Gosu Touch for both Release and Debug
For new projects:
• create new OpenGL ES project
• set up development key as usual
• get rid of main.m and the .nib file
• add Gosu's headers to the include path (I add
/opt/local/include and
/usr/local/include, and put a symlink named 'Gosu' in there that links to the framework's headers, so #include <Gosu/xxx.hpp> will work)
• add
-lgosutouch to the linker flags for Release,
-lgosutouch-sim to the linker flags for Debug, and make sure the 'lib' folder of Gosu is in the library search path
• add
CoreGraphics.framework,
OpenAL.framework,
AudioToolbox.framework and
AVFoundation.framework to your project
• comment out the main function, instead implement this global function:
Gosu::Window& windowInstance() { static MyWindowSubclass w; return w; }See the other thread on this board for all the version numbers (Device x.x.x, Simulator x.x.x, use gcc x.x.x etc.)
Missing: Accelerometer support is not there yet (just like on OS X, sadly), but you can already handle touchesBegan/Moved/Ended as a replacement for buttonDown.
Things to note: Touches' coordinates are in screen coordinates (e.g. 0…480, 0…320 on iPhone <4), same for drawing coordinates. You can change both using the undocumented Graphics::setResolution and Input::setMouseFactors if you need to.