Top Description Fields Constructors Methods
com.jogamp.opengl.util.texture

public Class TextureState

extends Object
Class Inheritance
Imports
com.jogamp.opengl.GL, .GL2ES2, .GL2ES3, .GL2GL3, .GLException

Preserves a [ texture-unit, texture-target ] state.

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

Field Summary

Modifier and TypeField and Description
private final int[]
state

  0 - unit
  1 - texture object
  2 - GL.GL_TEXTURE_MAG_FILTER
  3 - GL.GL_TEXTURE_MIN_FILTER
  4 - GL.GL_TEXTURE_WRAP_S
  5 - GL.GL_TEXTURE_WRAP_T
private final int

Constructor Summary

AccessConstructor and Description
public
TextureState(final GL
current GL context's GL object
gl
,
final int textureTarget)

Creates a texture state for the retrieved active texture-unit and the given texture-target.

public
TextureState(final GL
current GL context's GL object
gl
,
final int
of range [ GL#GL_TEXTURE0.. ]
textureUnit
,
final int textureTarget)

Creates a texture state for the given active texture-unit and the given texture-target.

Method Summary

Modifier and TypeMethod and Description
private static final int
activeTexture(final GL gl)

public final int
getMagFilter()

Returns the state's mag-filter param.

public final int
getMinFilter()

Returns the state's min-filter param.

public final int
getObject()

Returns the state's texture-object.

public final int
getTarget()

Returns the texture-target of this state, key value.

public static final int
getTextureTargetQueryName(final int textureTarget)

Returns the pname to query the textureTarget currently bound to the active texture-unit.

public final int
getUnit()

Returns the texture-unit of this state, key value.

public final int
getWrapS()

Returns the state's wrap-s param.

public final int
getWrapT()

Returns the state's wrap-t param.

public final void
restore(final GL
current GL context's GL object
gl
)

Restores the texture-unit's texture-target state.

private static final String
toHexString(final int i)

public final String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

stateback to summary
private final int[] state
  0 - unit
  1 - texture object
  2 - GL.GL_TEXTURE_MAG_FILTER
  3 - GL.GL_TEXTURE_MIN_FILTER
  4 - GL.GL_TEXTURE_WRAP_S
  5 - GL.GL_TEXTURE_WRAP_T
targetback to summary
private final int target

Constructor Detail

TextureStateback to summary
public TextureState(final GL gl, final int textureTarget) throws GLException

Creates a texture state for the retrieved active texture-unit and the given texture-target. See TextureState.

Parameters
gl:GL

current GL context's GL object

Exceptions
GLException:
if textureTarget is not supported
TextureStateback to summary
public TextureState(final GL gl, final int textureUnit, final int textureTarget) throws GLException

Creates a texture state for the given active texture-unit and the given texture-target. See TextureState.

Parameters
gl:GL

current GL context's GL object

textureUnit:int

of range [ GL#GL_TEXTURE0.. ]

Exceptions
GLException:
if textureTarget is not supported

Method Detail

activeTextureback to summary
private static final int activeTexture(final GL gl)
getMagFilterback to summary
public final int getMagFilter()

Returns the state's mag-filter param.

getMinFilterback to summary
public final int getMinFilter()

Returns the state's min-filter param.

getObjectback to summary
public final int getObject()

Returns the state's texture-object.

getTargetback to summary
public final int getTarget()

Returns the texture-target of this state, key value.

getTextureTargetQueryNameback to summary
public static final int getTextureTargetQueryName(final int textureTarget)

Returns the pname to query the textureTarget currently bound to the active texture-unit.

Returns 0 is textureTarget is not supported.

getUnitback to summary
public final int getUnit()

Returns the texture-unit of this state, key value. Unit is of range [ GL#GL_TEXTURE0.. ].

getWrapSback to summary
public final int getWrapS()

Returns the state's wrap-s param.

getWrapTback to summary
public final int getWrapT()

Returns the state's wrap-t param.

restoreback to summary
public final void restore(final GL gl)

Restores the texture-unit's texture-target state.

First the texture-unit is activated, then all states are restored.

Parameters
gl:GL

current GL context's GL object

toHexStringback to summary
private static final String toHexString(final int i)
toStringback to summary
public final String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override