Search code examples
androidopengl-esjogl

JOGL vs OpenGL ES API on Android. Pros&Cons


We are trying to migrate our project from PC version to Android. PC version uses JOGL. Can anyone explain main advantages of using JOGL in Android application instead of OpenGL ES API?

For example, on PC pros of JOGL are:

  1. In theory you can use it on any platform.
  2. It's more or less integrated with AWT, Swing and SWT.
  3. Also it's some kind of wrapper, so in theory there are some abstractions that make it easier to use OpenGL.

But I can't see advantages of using it in Android, here are the cons from my point of view:

  1. It's another dependency, APK size will be larger.
  2. Some issues that affect both JOGL and OpenGL ES will require more time to pinpoint and fix.
  3. It's not a silver bullet that would not require some time for refactoring, since in Android we should use right patterns for Activities, Services, etc.
  4. JOGL has less tutorials and smaller community that OpenGL ES API has.

So what's the point of using it in Android project?


Solution

  • You can use JOGL only on the platforms that we support. I confirm that JOGL has a good interoperability with AWT, Swing and SWT (not yet with OpenJFX/JavaFX but we'll improve that when Oracle does the necessary things). Yes there are some nice abstractions but you forget tons of things:

    • JOGL has its own AWT-free image management. It has a better support of JPEG than ImageIO and it is faster
    • You can preserve the OpenGL context even when your application is paused and put in background (when you press "home"), it's build-in
    • You can test your OpenGL-ES code on your computer even though it doesn't replace the tests on a real device
    • You can use exactly the same OpenGL code on desktop and embedded environments, especially if you already use GL2ES2
    • you can rely on us if something goes wrong, there are already a few commercial games on Google Play

    I admit that there is a lack of documentation about JOGL under Android. I'm sorry, I have spent several months in writing a tutorial about JogAmp's Ardor3D Continuation and I prefer leaving the task of doing the same for JOGL Android usage to someone more experienced with it.

    Edit.: Sorry for the late reply but I had a problem with my OpenID. Please rather post questions about JOGL on our official forum.