In this tutorial I will show you how to setup the Xcode IDE for the SoftPixel Engine (v.3.1) and iOS.
First of all you will need an Apple computer: iMac, Mac Mini or Mac Book etc. with an Intel processor.
You cannot use an old Mac with a PowerPC processor to develop for iOS! I bought an old Mac Mini of the
2nd generation on eBay for 250€ which was the cheapest way for me.
Then update at least to Mac OS X Leopard (OS X 10.5) because you need at least Xcode 3. I'm using OS X Snow Leopard (OS X 10.6)
and the latest Xcode 3.x version.
After updating your Mac OS X system and installing Xcode 3 (you can also use
Xcode 4 but this tutorial is for 3.x)
create a new project and choose the following template:
"iOS" -> "Application" -> "OpenGL ES Application" (As shown below).
This will create a small OpenGL|ES application in
Don't worry if you don't know the Objective-C programming language. Just change the extension "*.m" to "*.mm" for all files.
Because we want to use Objective-C++. For iOS you always need to write a small part of your code in Objective-C (or Objective-C++)
to have access to the Cocoa framework.
i.e. the OpenGL context needs to be created in Objective-C. The rest of your whole application can be written in C++.
This part cannot be done in the SoftPixel Engine library. Thus you need to do this by yourself. But this is already done
by the OpenGL ES template.
The next thing we do is to add some new files. At first the libSoftPixelEngine.a static library file (As shown below in the first red box).
The next files are "Tutorial.cpp" and "Tutorial.h". For more information about the source code please look inside these files
(This tutorial with all its files is included in the SoftPixel Engine SDK). Last not least the resource files (Shown below in the third red box).
Now we also need to make some project configuration changes. Open the project settings under: "Project" -> "Edit Project Settings ...".
Make sure you make theses changes for all settings (Debug and Relase). In the image below I only used "Release". Then search for "Header Search Paths"
and enter two paths: the "sources" folder of the SoftPixel Engine and the Boost include folder. In my case I used "boost_1_48_0".
That's about it and you can start developing with the SoftPixel Engine on iOS. First only use the iPhone Simulator.
When want to test and release your App on a real iOS device (iPhone, iPod Touch or iPad) you need to join the
Apple iOS Developer Program for 99$ per year.
To compile and start your App click "Build and Run". If you have questions please join our community.