# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Methods | Inherited Methods

# GLUtils

`public final class GLUtils`
`extends Object` ``

java.lang.Object
↳ | android.opengl.GLUtils

Utility class to help bridging OpenGL ES and Android APIs.

## Summary

### Public methods
`static String` | `getEGLErrorString(int error)` Return a string for the EGL error code, or the hex representation if the error is unknown.
`static int` | `getInternalFormat(Bitmap bitmap)` return the internal format as defined by OpenGL ES of the supplied bitmap.
`static int` | `getType(Bitmap bitmap)` Return the type as defined by OpenGL ES of the supplied bitmap, if there is one.
`static void` | `texImage2D(int target, int level, Bitmap bitmap, int border)` A version of texImage2D that determines the internalFormat and type automatically.
`static void` | `texImage2D(int target, int level, int internalformat, Bitmap bitmap, int border)` Calls glTexImage2D() on the current OpenGL context.
`static void` | `texImage2D(int target, int level, int internalformat, Bitmap bitmap, int type, int border)` A version of texImage2D() that takes an explicit type parameter as defined by the OpenGL ES specification.
`static void` | `texSubImage2D(int target, int level, int xoffset, int yoffset, Bitmap bitmap, int format, int type)` A version of texSubImage2D() that takes an explicit type parameter as defined by the OpenGL ES specification.
`static void` | `texSubImage2D(int target, int level, int xoffset, int yoffset, Bitmap bitmap)` Calls glTexSubImage2D() on the current OpenGL context.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public methods

### getEGLErrorString

    public static String getEGLErrorString (int error)

Return a string for the EGL error code, or the hex representation if the error is unknown.

Parameters
`error` | `int`: The EGL error to convert into a String.

Returns
`String` | An error string corresponding to the EGL error code.

### getInternalFormat

    public static int getInternalFormat (Bitmap bitmap)

return the internal format as defined by OpenGL ES of the supplied bitmap.

Returns
`int` | the internal format of the bitmap.

### getType

    public static int getType (Bitmap bitmap)

Return the type as defined by OpenGL ES of the supplied bitmap, if there is one. If the bitmap is stored in a compressed format, it may not have a valid OpenGL ES type.

Returns
`int` | the OpenGL ES type of the bitmap.

Throws
`IllegalArgumentException` | if the bitmap does not have a type.

### texImage2D

    public static void texImage2D (int target,
                    int level,
                    Bitmap bitmap,
                    int border)

A version of texImage2D that determines the internalFormat and type automatically.

### texImage2D

    public static void texImage2D (int target,
                    int level,
                    int internalformat,
                    Bitmap bitmap,
                    int border)

Calls glTexImage2D() on the current OpenGL context. If no context is current the behavior is the same as calling glTexImage2D() with no current context, that is, eglGetError() will return the appropriate error. Unlike glTexImage2D() bitmap cannot be null and will raise an exception in that case. All other parameters are identical to those used for glTexImage2D(). NOTE: this method doesn't change GL_UNPACK_ALIGNMENT, you must make sure to set it properly according to the supplied bitmap. Whether or not bitmap can have non power of two dimensions depends on the current OpenGL context. Always check glGetError() some time after calling this method, just like when using OpenGL directly.

### texImage2D

    public static void texImage2D (int target,
                    int level,
                    int internalformat,
                    Bitmap bitmap,
                    int type,
                    int border)

A version of texImage2D() that takes an explicit type parameter as defined by the OpenGL ES specification. The actual type and internalformat of the bitmap must be compatible with the specified type and internalformat parameters.

### texSubImage2D

    public static void texSubImage2D (int target,
                    int level,
                    int xoffset,
                    int yoffset,
                    Bitmap bitmap,
                    int format,
                    int type)

A version of texSubImage2D() that takes an explicit type parameter as defined by the OpenGL ES specification.

Parameters
`format` | `int`

### texSubImage2D

    public static void texSubImage2D (int target,
                    int level,
                    int xoffset,
                    int yoffset,
                    Bitmap bitmap)

Calls glTexSubImage2D() on the current OpenGL context. If no context is current the behavior is the same as calling glTexSubImage2D() with no current context, that is, eglGetError() will return the appropriate error. Unlike glTexSubImage2D() bitmap cannot be null and will raise an exception in that case. All other parameters are identical to those used for glTexSubImage2D(). NOTE: this method doesn't change GL_UNPACK_ALIGNMENT, you must make sure to set it properly according to the supplied bitmap. Whether or not bitmap can have non power of two dimensions depends on the current OpenGL context. Always check glGetError() some time after calling this method, just like when using OpenGL directly.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*