OpenGL ES and Java ME

OpenGL ES, like OpenGL, is a C-based, flat API. Because the Android SDK is a Java-based programming API, you need a Java binding to OpenGL ES. Java ME has already defined this binding through JSR 239: Java Binding for the OpenGL ES API. JSR 239 itself is based on JSR 231, which is a Java binding for OpenGL 1.5. JSR 239 could have been strictly a subset of JSR 231, but that's not the case because it must accommodate some extensions to OpenGL ES that are not in OpenGL 1.5.

You can find the documentation for JSR 239 here:

http://java.sun.com/javame/reference/apis/jsr239/

This reference will give you a sense of the APIs available in OpenGL ES. It also provides valuable information about these packages:

javax.microedition.khronos.egl javax.microedition.khronos.opengles java.nio

The nio package is necessary because the OpenGL ES implementations take only byte streams as inputs for efficiency reasons. nio defines a lot of utility buffers for this purpose. You will see some of these in action in the "glVertexPointer and Specifying Drawing Vertices" subsection under the main "Using OpenGL ES" section.

You can find minimal documentation of the Android SDK's support for OpenGL at this site:

http://developer.android.com/guide/topics/graphics/opengl.html

On this page, the documentation indicates that the Android implementation mostly parallels JSR 239 but warns that it might diverge from it in a few places.

0 0

Post a comment