Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

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
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

Your Answer


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.