com.neovisionaries.android.opengl
Class TextureCubeMap

java.lang.Object
  extended by com.neovisionaries.android.opengl.Texture<TextureCubeMap>
      extended by com.neovisionaries.android.opengl.TextureCubeMap

public class TextureCubeMap
extends Texture<TextureCubeMap>

OpenGL ES cube map texture.

Author:
Takahiko Kawasaki

Constructor Summary
TextureCubeMap()
          A constructor to create a cube map texture (GL_TEXTURE_CUBE_MAP).
 
Method Summary
 boolean isBound()
          Check if this 2D texture is bound.
 TextureCubeMap loadImage(Bitmap bitmap, CubeSide side)
          This method is an alias of loadImage(bitmap, 0, side).
 TextureCubeMap loadImage(Bitmap bitmap, int level, CubeSide side)
          Load an image.
 
Methods inherited from class com.neovisionaries.android.opengl.Texture
bind, delete, generateMipmap, getId, getState, getType, getUnit, setMagFilter, setMinFilter, setUnit, setWrapS, setWrapT
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextureCubeMap

public TextureCubeMap()
               throws GLESException
A constructor to create a cube map texture (GL_TEXTURE_CUBE_MAP). super(TextureType.CUBE_MAP) is called. After this constructor returns, the state of this instance is CREATED.

Throws:
GLESException - glGenTextures() failed.
See Also:
Texture.Texture(TextureType), glGenTextures
Method Detail

isBound

public boolean isBound()
Check if this 2D texture is bound.

This method returns true (1) if the current active texture unit is the same as the one that this texture should be bound to and (2) if the value returned from GLESState.getTextureBindingCubeMap() and the value returned from Texture.getId() are identical.

Specified by:
isBound in class Texture<TextureCubeMap>
Returns:
True if this cube map texture is bound.
See Also:
GLESState.getActiveTexture(), GLESState.getTextureBindingCubeMap()

loadImage

public TextureCubeMap loadImage(Bitmap bitmap,
                                int level,
                                CubeSide side)
Load an image.

If this texture is not bound when this method is called, bind() is called first. Then, GLUtils.texImage2D(side.getSide(), level, bitmap, 0) is called.

Parameters:
bitmap - Image to load.
level - Mipmap level.
side - Cube side.
Throws:
IllegalArgumentException - 'bitmap' is null or 'level' is less than 0.
IllegalStateException - This texture has already been deleted.
See Also:
GLUtils.texImage2D, glTexImage2D

loadImage

public TextureCubeMap loadImage(Bitmap bitmap,
                                CubeSide side)
This method is an alias of loadImage(bitmap, 0, side).