Java, with no Java!

A few weeks ago I saw this video on channel 9 about the new hardware acceleration features being added to IE9. In reality this is nothing new, I saw news reports of Mozilla talking about adding similar to FireFox at least a year ago. But to see it in action brought home a certain reality.

One of the key selling points for me using Java for building my games is that all of the graphics are hardware accelerated, all thanks to the OpenGL bindings. There is no worry about the number of images I’m using and if they are transparent. With hardware accelerated support in the browser this advantage is just no longer true.

The need for hardware acceleration is apparent if you look at some of the current high-end HTML 5 examples. There are some great ones over at Chrome Experiments.com, my favourites being a partial port of Another World. But some others make my PC grind to a crawl. However even with HTML 5 I’d then have to write all my games in JavaScript; a language far more combersume and limiting then Java.

Java to JavaScript

So next enters GWT, the Google Web Toolkit. A library for building GUIs in JavaScript. But what’s interesting is that it’s written and compiled from Java code.

I’ve been playing around with it over the last few weeks and if you’ve got any experience using something like Swing then you’ll find it a synch to use. They have a nice page showing all of the core widgets included here, but even nicer is their mock mail app example.

The potential here is that I could write a game in Java and not have to rely on the plugin being present. But even if the graphics are hardware accelerated it’s still not the same without the OpenGL bindings. Lots of little effects and tweaks I’d like to perform for which I need them to be able to perform. The solution? WebGL!

GFX FTW!

A new standard in development (here) and already supported by FireFox, Chrome, Opera and Safari (although it seems only via experimental nightly builds on FF). This would be perfect and is what I’d love to be using. It’s just a shame that only one of those browsers has a percentage of users in the double digits, and even then nothing compared to IE. Until that changes it’s just not practical to use. That pains me.

Any JVM bugs users experience automatically get blamed on my games (that is where the user saw them occur). It’s also not as cross-platform as I once thought (although still excellent at this). I’d ultimately love to have the same environment I have right now, writing Java code that uses OpenGL, but with no actual Java backend. That would be heaven.

Leave a Reply