5
\$\begingroup\$

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.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ needsmorejquery.com :) jQuery really is great and does all things. Interesting question, dude. \$\endgroup\$
    – Almo
    Jun 3, 2013 at 17:36
  • \$\begingroup\$ 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. \$\endgroup\$ Jun 3, 2013 at 17:48

1 Answer 1

2
\$\begingroup\$

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.

\$\endgroup\$
1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .