Class TextureState

java.lang.Object
com.jogamp.opengl.util.texture.TextureState

public class TextureState extends Object
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
 
  • Constructor Summary

    Constructors
    Constructor
    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.
  • Method Summary

    Modifier and Type
    Method
    Description
    final int
    Returns the state's mag-filter param.
    final int
    Returns the state's min-filter param.
    final int
    Returns the state's texture-object.
    final int
    Returns the texture-target of this state, key value.
    static final int
    getTextureTargetQueryName(int textureTarget)
    Returns the pname to query the textureTarget currently bound to the active texture-unit.
    final int
    Returns the texture-unit of this state, key value.
    final int
    Returns the state's wrap-s param.
    final int
    Returns the state's wrap-t param.
    final void
    restore(GL gl)
    Restores the texture-unit's texture-target state.
    final String
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TextureState

      public TextureState(GL gl, int textureTarget) throws GLException
      Creates a texture state for the retrieved active texture-unit and the given texture-target. See TextureState.
      Parameters:
      gl - current GL context's GL object
      textureTarget -
      Throws:
      GLException - if textureTarget is not supported
    • TextureState

      public TextureState(GL gl, int textureUnit, int textureTarget) throws GLException
      Creates a texture state for the given active texture-unit and the given texture-target. See TextureState.
      Parameters:
      gl - current GL context's GL object
      textureUnit - of range [ GL.GL_TEXTURE0.. ]
      textureTarget -
      Throws:
      GLException - if textureTarget is not supported
  • Method Details

    • getTextureTargetQueryName

      public static final int getTextureTargetQueryName(int textureTarget)
      Returns the pname to query the textureTarget currently bound to the active texture-unit.

      Returns 0 is textureTarget is not supported.

    • restore

      public final void restore(GL gl)
      Restores the texture-unit's texture-target state.

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

      Parameters:
      gl - current GL context's GL object
    • getUnit

      public final int getUnit()
      Returns the texture-unit of this state, key value. Unit is of range [ GL.GL_TEXTURE0.. ].
    • getTarget

      public final int getTarget()
      Returns the texture-target of this state, key value.
    • getObject

      public final int getObject()
      Returns the state's texture-object.
    • getMagFilter

      public final int getMagFilter()
      Returns the state's mag-filter param.
    • getMinFilter

      public final int getMinFilter()
      Returns the state's min-filter param.
    • getWrapS

      public final int getWrapS()
      Returns the state's wrap-s param.
    • getWrapT

      public final int getWrapT()
      Returns the state's wrap-t param.
    • toString

      public final String toString()
      Overrides:
      toString in class Object