O'Reilly logo

OpenGL ES 2 for Android by Kevin Brothaler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Static Imports

This is the first point where we use the import static directive. We’ll be using this a lot in our code, as this directive helps to greatly reduce verbosity by reducing a call like GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT); to glClear(GL_COLOR_BUFFER_BIT);. This makes a big difference when a significant amount of our code is working with OpenGL and other utilities.

Unfortunately, Eclipse doesn’t have great support for static imports. To make things easier, I recommend that you select WindowPreferences and then select JavaEditorContent AssistFavorites and add the following types:

  • android.opengl.GLES20

  • android.opengl.GLUtils

  • android.opengl.Matrix

This will help with autocomplete, but unfortunately it won’t fix ‘Organize ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required