Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I was wondering if anyone has come across any articles detailing how to set up a basic game in C++ for use in Android / IPhone / Desktop applications.

My thoughts just now are that I would like to make my game as a library and have a different project for each device which just interfaces with this library. You know the kind of thing, bootstrap the program, call some library initialize, load and run routines and occasionally pass some information to the library like input. I was hoping someone would have made a template for this kind of thing but I just had no luck finding one.

It seems to me that it's the kind of thing you really only have to do once, so I was hoping someone would have done it for me already.

share|improve this question
add comment

3 Answers

You could try looking though the ludum dare site. Many of those games are basic, work with multiple OSes and are open source. Additionally, it's a regular thing to share what you already have prepared before the competition starts. That's a good place to look for boilerplate code.

share|improve this answer
add comment

I'm working on doing a simple template for OS X, Android and iPhone. It will be available in few days on my blog. The project should be easily portable on Windows and Linux because i use glfw.

share|improve this answer
add comment
up vote 0 down vote accepted

Cocos2d-x will generate projects for each platform you wish to develop on and link it to some basic, shared C++ code.

While the intention of this is to get cocos2d-x projects up and running, there is nothing to stop you stripping all the cocos2d-x related code from your project and just doing your own thing.

You might want to keep some cocos2d-x things in the final project, like cocos2d-x features for getting user input, but because cocos2d-x is open source, you can always replace this.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.