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 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  
needsmorejquery.com :) 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; docs.phonegap.com/en/2.7.0/… 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
add comment

1 Answer

up vote 1 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. docs.phonegap.com/en/2.0.0/guide_cordova-webview_index.md.html –  Eat at Joes Jun 3 '13 at 19:45
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.