|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neovisionaries.android.opengl.Texture<TTexture>
public abstract class Texture<TTexture extends Texture<TTexture>>
OpenGL ES texture.
Constructor Summary | |
---|---|
protected |
Texture(TextureType type)
A constructor with a texture type. |
Method Summary | |
---|---|
TTexture |
bind()
Bind this texture using glBindTexture(). |
TTexture |
delete()
Delete this texture object using glDeleteTextures(). |
TTexture |
generateMipmap()
Generate mipmaps. |
int |
getId()
Get the ID of this texture. |
TextureState |
getState()
Get the state of this texture. |
TextureType |
getType()
Get the type of this texture. |
int |
getUnit()
Get the texture unit that this texture should be bound to. |
abstract boolean |
isBound()
Check if this texture is bound. |
TTexture |
setMagFilter(MagFilter filter)
Set a mag filter. |
TTexture |
setMinFilter(MinFilter filter)
Set a min filter. |
TTexture |
setUnit(int textureUnit)
Set the texture unit that this texture should be bound to. |
TTexture |
setWrapS(WrapMode mode)
Set a wrap mode for S coordinates of textures. |
TTexture |
setWrapT(WrapMode mode)
Set a wrap mode for T coordinates of textures. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Texture(TextureType type) throws GLESException
TextureState.CREATED
.
type
- A texture type.
IllegalArgumentException
- The given argument is null.
GLESException
- glGenTextures() failed.Texture2D.Texture2D()
,
TextureCubeMap.TextureCubeMap()
,
glGenTexturesMethod Detail |
---|
public TextureType getType()
public int getId()
public TextureState getState()
public int getUnit()
public TTexture setUnit(int textureUnit)
textureUnit
- A texture unit number. 0 means GL_TEXTURE0.
The range of the number is from 0 to (GLESState.getMaxTextureImageUnits()
- 1).
IllegalArgumentException
- GLESState.getMaxTextureImageUnits()
,
glBindTexturepublic TTexture bind()
If the current active texture unit is not the one that
this texture should be bound to (= the one that has been
set by setUnit(int)
), glActiveTexture()
is called before glBindTexture().
IllegalStateException
- This texture has already been deleted.GLESState.getActiveTexture()
,
glActiveTexture,
glBindTexturepublic TTexture delete()
TextureState.DELETED
.
public abstract boolean isBound()
public TTexture setMagFilter(MagFilter filter)
If this texture is not bound when this method is called,
bind()
is called before
glTexParameter(GL_TEXTURE_MAG_FILTER, filter.getFilter()
) is called.
filter
- A mag filter.
IllegalArgumentException
- 'filter' is null.
IllegalStateException
- This texture has already been deleted.public TTexture setMinFilter(MinFilter filter)
If this texture is not bound when this method is called,
bind()
is called before
glTexParameter(GL_TEXTURE_MIN_FILTER, filter.getFilter()
) is called.
filter
- A min filter.
IllegalArgumentException
- 'filter' is null.
IllegalStateException
- This texture has already been deleted.public TTexture setWrapS(WrapMode mode)
If this texture is not bound when this method is called,
bind()
is called before
glTexParameter(GL_TEXTURE_WRAP_S, mode.getMode()
) is called.
mode
- A wrap mode.
IllegalArgumentException
- 'mode' is null.
IllegalStateException
- This texture has already been deleted.public TTexture setWrapT(WrapMode mode)
If this texture is not bound when this method is called,
bind()
is called before
glTexParameter(GL_TEXTURE_WRAP_T, mode.getMode()
) is called.
mode
- A wrap mode.
IllegalArgumentException
- 'mode' is null.
IllegalStateException
- This texture has already been deleted.public TTexture generateMipmap()
If this texture is not bound when this method is called,
bind()
is called first. Then glGenerateMipmap()
is called.
IllegalStateException
- This texture has already been deleted.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |