Android
android.opengl
public final class

android.opengl.GLUtils

java.lang.Object
android.opengl.GLUtils

Utility class to help bridging OpenGL ES and Android APIs.

Summary

Public Methods

      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.
      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  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, Bitmap bitmap, int border)
A version of texImage2D that determines the internalFormat automatically.
      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.
Methods inherited from class java.lang.Object

Details

Public Methods

public static int getInternalFormat(Bitmap bitmap)

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

Returns

  • the internal format of the bitmap.

public static int getType(Bitmap bitmap)

Return the type as defined by OpenGL ES of the supplied bitmap.

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.

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.

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

A version of texImage2D that determines the internalFormat automatically.

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.

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.
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48