iDevGames Forums
A couple of questions from a novice. - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: iPhone, iPad & iPod Game Development (/forum-11.html)
+--- Thread: A couple of questions from a novice. (/thread-1373.html)



A couple of questions from a novice. - ebulmer - Apr 30, 2009 01:48 AM

Hi Guys,

First of all I should point out that I'm very new to iPhone development. I decided that I wanted to do it professionally when I finish my Computer Science degree (I'm majoring in Games Programming); because with the recession none of the local game development companies are hiring newly graduated programmers.

Anyway, I had a couple of questions that I thought you might be well positioned to answer.

First of all I'm interested in the role C++ plays in games programming on the iPhone. So I had a couple of questions in this vein:

1. How low-level is it worth going with c++? As in, is it worth implementing my own memory manager using c++ or multi-threading code?

2. How interoperable is c++ with OpenGL|ES or the higher-level Cocoa classes (like the UIAccelerometerDelegate for example) ?

3. Is it worth implementing frequently used classes in c++ (Vector2, Quarternion4, Matrix4x4 etc)? - I mainly ask about this because I sorely miss operator overloading; I've had Objective-C message blocks that end in tons of ]s without it.

I'll leave it as that for now; those are the main ones I'm interested in. I mainly ask because I did a lot of work on a game engine in c++ earlier this year that I could possibly port to the iphone. Only problem is it uses its own memory management and execution scheme which I'm not sure whether it will mesh well with the iPhone.

Sorry for the long post and (possibly) the noob questions.

Any info would be great. Thanks. Grin


A couple of questions from a novice. - AnotherJake - Apr 30, 2009 06:30 AM

1) I'm no C++ expert, but it seems to me there is no problem with implementing your own memory management scheme if you want to. I wouldn't bother with multi-threading on iPhone.

2) You can only message Cocoa with Objective-C, but Objective-C++ makes it more compatible with your C++ code (I don't know if that makes any sense, but I can't think of a better way to put it at the moment). OpenGL is interfaced via C, but that's not an issue either. Check out the oolongengine which is a C++ engine using OpenGL on iPhone for example code.

3) Yes, it is totally worth writing your own overloaded operators with graphics math classes in C++, that's what C++ is all about! Don't use Objective-C for that. You want the fastest possible code there, so stick to C or C++ for your math routines.


A couple of questions from a novice. - warmi - Apr 30, 2009 07:51 AM

If you are interested in coding for OpenGL then you can pretty much skip Objective C and Apple frameworks altogether.

All you need is a few thin classes encapsulating basic OS functionality and you are set.

Between boost and std C++ already has everything you need.


A couple of questions from a novice. - ebulmer - Apr 30, 2009 07:50 PM

Thanks for the prompt replies.

That's great news! It means I should be able to take my engine code and port it to the iPhone without too much drama. I'll have a look at that oolongengine to give me an idea on how to do it.

One last question: At the moment I'm testing my applications on a iTouch 2G; do you know if there is much of a difference in the hardware capability between the iTouch and the iPhone?

I only ask because down the track I may want to try out some more performance-heavy concepts (I had a neat idea for a game that uses a 2d fluid solver) which means I'll want to be testing them out initially on the strongest platform I can. Hence, it might be worth my while looking at getting an iPhone 3G when they come out.

Thanks again for your replies. Grin


A couple of questions from a novice. - AnotherJake - Apr 30, 2009 08:31 PM

No there's not really any significant performance difference. If anything, maybe a little faster on the second gen iPod Touch, but not enough to consider any extra software capabilities.


A couple of questions from a novice. - ebulmer - Apr 30, 2009 08:50 PM

Awesome, looks like I'm all set to go. A couple more questions:

I tried downloading and running the oolong engine examples; however, the .xcodeproj for a lot of the examples won't build and go because I don't have Wolfgang Engel's certificate in my keychain. Does that mean I simply need to create a new .xcodeproj and add the source code myself to recompile it?

Also, I'm sending my CV and a small demo application to a potential employer soon; what would be the best way to make sure he can simply load the project up and get it going? Assuming this problem would also affect him if he doesn't have my certificate in his keychain? Is there a way of just transfering the .app file to the device without needing xcode?


A couple of questions from a novice. - AnotherJake - May 1, 2009 07:16 AM

ebulmer Wrote:I tried downloading and running the oolong engine examples; however, the .xcodeproj for a lot of the examples won't build and go because I don't have Wolfgang Engel's certificate in my keychain. Does that mean I simply need to create a new .xcodeproj and add the source code myself to recompile it?
Just switch the certificate in the target settings to your certificate.

ebulmer Wrote:Also, I'm sending my CV and a small demo application to a potential employer soon; what would be the best way to make sure he can simply load the project up and get it going? Assuming this problem would also affect him if he doesn't have my certificate in his keychain? Is there a way of just transfering the .app file to the device without needing xcode?
If the prospective employer is an iPhone developer, they'll know what to do if you send them the project. Otherwise, if you want to send an executable you'll need to use Ad Hoc Distribution. It requires that you are a paying iPhone developer, and Ad Hoc is a pain in the butt to figure out. If you can do it though, all you have to send is the app and a provisioning profile, which they can install on their iPhone/iPod by dragging the two files onto iTunes.