Interface GL

All Known Subinterfaces:
GL10, GL10Ext, GL11, GL11Ext, GL11ExtensionPack, GL20

public interface GL

The GL interface is the parent interface for the Java™ programming language bindings for OpenGL® ES 2.0, 1.1, and 1.0 and the corresponding OpenGL ES extensions.

The documentation in this interface and its subinterfaces is normative with respect to instance variable names and values, method names and signatures, and exception behavior. The remaining documentation is placed here for convenience and does not replace the normative documentation found in the OpenGL ES 2.0, 1.1 and 1.0 specifications, relevant extension specifications, and the desktop OpenGL specifications they reference.

A GL object is obtained by calling EGLContext.getGL(). The returned object implements GL20, GL11, or GL10 and any associated extension interfaces such as GL11Ext, GL11ExtensionPack, or GL10Ext. You must cast the returned object to the appropriate interface before you can call GL methods. You might call instanceof to check the type of the interface before you cast it.

OpenGL ES 2.0, OpenGL ES 1.1, OpenGL ES 1.0 and the core extensions defined by Khronos all share a common superinterface. You can check the version of OpenGL ES a device supports by examining the value glGetString(GL.GL_VERSION) returns.

Some extensions are defined as a core part of the OpenGL ES specification. These extensions correspond to desktop OpenGL extensions. The methods in these extensions are treated as normal components of OpenGL ES, but you can query for them as extensions using the normal OpenGL ES query mechanisms.

Extensions might accept argument values other than those listed in this specification. Implementations that provide a given extension can pass such values to the underlying engine.

You can find optional profile extensions in the GL11Ext, GL11ExtensionPack and GL10Ext interfaces.

Vertex Buffer Objects

Vertex buffer objects are enabled if the most recent call to glBindBuffer had a target of GL_ARRAY_BUFFER and a non-zero buffer parameter. When Vertex buffer objects are enabled, you can only call variants of gl*Pointer methods that have an integer offset parameter. When Vertex buffer objects are disabled, you can only call variants of gl*Pointer methods that have a Buffer parameter.


If the description of a method says that a value x is clamped to a range [A, B], it means that the value min(max(x, A), B) is used in place of the value x.

BlackBerry API 5.0.0

Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.