public class TextureState extends Object
The states keys are the retrieved active texture-unit and the given texture-target for which the following states are being queried:
- texture-object - GL.GL_TEXTURE_MAG_FILTER - GL.GL_TEXTURE_MIN_FILTER - GL.GL_TEXTURE_WRAP_S - GL.GL_TEXTURE_WRAP_T
Constructor and Description |
---|
TextureState(GL gl,
int textureTarget)
Creates a texture state for the retrieved active texture-unit and the given texture-target.
|
TextureState(GL gl,
int textureUnit,
int textureTarget)
Creates a texture state for the given active texture-unit and the given texture-target.
|
Modifier and Type | Method and Description |
---|---|
int |
getMagFilter()
Returns the state's mag-filter param.
|
int |
getMinFilter()
Returns the state's min-filter param.
|
int |
getObject()
Returns the state's texture-object.
|
int |
getTarget()
Returns the texture-target of this state, key value.
|
static int |
getTextureTargetQueryName(int textureTarget)
Returns the
pname to query the textureTarget currently bound to the active texture-unit. |
int |
getUnit()
Returns the texture-unit of this state, key value.
|
int |
getWrapS()
Returns the state's wrap-s param.
|
int |
getWrapT()
Returns the state's wrap-t param.
|
void |
restore(GL gl)
Restores the texture-unit's texture-target state.
|
String |
toString() |
public TextureState(GL gl, int textureTarget) throws GLException
TextureState
.gl
- current GL context's GL objecttextureTarget
- GLException
- if textureTarget is not supportedpublic TextureState(GL gl, int textureUnit, int textureTarget) throws GLException
TextureState
.gl
- current GL context's GL objecttextureUnit
- of range [ GL.GL_TEXTURE0
.. ]textureTarget
- GLException
- if textureTarget is not supportedpublic static final int getTextureTargetQueryName(int textureTarget)
pname
to query the textureTarget
currently bound to the active texture-unit.
Returns 0
is textureTarget
is not supported.
public final void restore(GL gl)
First the texture-unit is activated, then all states are restored.
gl
- current GL context's GL objectpublic final int getUnit()
GL.GL_TEXTURE0
.. ].public final int getTarget()
public final int getObject()
public final int getMagFilter()
public final int getMinFilter()
public final int getWrapS()
public final int getWrapT()
Copyright 2010 JogAmp Community.