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 Window→Preferences and then select Java→Editor→Content Assist→Favorites 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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access