Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

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 have a few games for the iPhone, Android, and Windows 8 that I built using native C++. This works great but is really limiting when I try to create menus and start screens.

I have read about rapid development using jQuery Mobile and Phonegap but have never used any of these frameworks. However there looks to be an advantage using this to ceate my game menus and simple screens.

Is it possible to mix my existing C++/OpenGL game code with JavaScript used for simple navigation, obviously this would need to compile into a native binary for iOS, Android, and BB. Is this possible?

I am all ears to any of the following to solve this; a framework, technique, or any approach that can make this happen.

share|improve this question
1 :) jQuery really is great and does all things. Interesting question, dude. – Almo Jun 3 '13 at 17:36
Since posting I did find Cordova/Phonegap has the concept of plugin's that allow me to call native code in most devices;… this may be the best solution? Unfortunately it requires sending weak arguments to weak objects registered in configuration. – Eat at Joes Jun 3 '13 at 17:48
up vote 2 down vote accepted

See the PhoneGap Plugins Wiki page.

For Android you write an Java plugin that wraps your native C++ code via JNI and then you can use that as a plugin for PhoneGap. For iOS, you'd write an Objective-C++ wrapper. Other platforms have their own native interfaces, which generally you can use as a shim between PhoneGap/JavaScript and C++. There are other technologies similar to PhoneGap that likely work the same way. I'm not aware if you can directly bind native C++ with the PhoneGap API, but if you can, the documentation should describe how; otherwise you're going to have to write a platform-specific shim.

share|improve this answer
This looks like the best approach. On the same vein - PhoneGap's WebView looked promising. – Eat at Joes Jun 3 '13 at 19:45

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.