I started working on the libgdx RoboVM backend yesterday. RoboVM is an ahead-of-time compiler for JVM bytecode, that targets iOS. It’s completely free for commercial usage, supports the entire JRE (through Android’s runtime class library), has super easy integration with Eclipse and soon Maven, and is all-around fantastics. Development is really fast, compile times are in the seconds range for the simulator (once the JRE has been compiled).
I’m doing this mostly because i want to offer a free alternative for the Xamarin/Monotouch based backend. Xamarin has been super supportive of our efforts in the past, but there are some technical hurdles that we can’t seem to overcome, e.g full JRE support, JNI performance, high compile times etc.
I got all our demo games to work in an hour. Niklas Therning, the guy behind RoboVM, supplied us with an initial RoboVM backend. I had to fix up a minor issues with ApplicationListener initialization order, and things just started to work.
It’s still early days. There’s a lot that needs to be done, but i have high hopes that this will become our new defacto iOS backend.
What’s currently missing in the backend:
- touch coords are incorrect
- no audio yet
- Preferences are broken
- some missing implementations
What’s currently missing in RoboVM:
- More optimizations. Performance seems to be good enough already, JNI calls seem to be a lot cheaper than with IKVM/Monotouch. I’m not sure if RoboVM uses LLVM’s full optimization pipeline yet.
- A few bugs here and there, which we want to help to discover. RoboVM is tested against Android’s class library test suite, and pretty much all the tests pass.
One downside to RoboVM, apart from missing debugging support, is the use of the Boehm GC. Now, Mono (and hence Unity et al.) have been using that for quite a while, and with a little care, one can work around it’s issues (stop-the-world pauses).
My plan is to focus on this backend in the future, and only do maintenance on the Monotouch backend. If you feel to be able to help with the RoboVM backend, i’d welcome your contributions!
You can currently test the thing by
- Checking out libgdx’s source, fetching the natives, and importing things into Eclipse
- Install RoboVM and its dependencies (XCode, llvm)
- Install the RoboVM Eclipse plugin
- In Eclipse, right click any of the iosrobovm demo project (e.g. superjumper-iosrobovm), Run As -> iOS Simulator App (iPhone)
The backend source can be found on the master branch on github. It’s just like any other libgdx backend, single Java project that links to the core API and RoboVM runtime classes. Creating a new libgdx robovm project is as simple as linking to gdx/gdx-backend-robovm, and modifying the robovm.xml, robovm.properties, and info.plist files to meet your project’s requirements. See the demo game projects for examples.
I’ll package up the robovm backend in the nightlies asap for you to consume. For now you’ll have to work from source as outlined above.
And here’s a screeny: