Class TextureImage

java.lang.Object
com.jme3.texture.TextureImage

public class TextureImage extends Object
Wraps a texture so that only a single level of the underlying image is bound instead of the entire image.
  • Constructor Details

  • Method Details

    • bindImage

      public void bindImage(GL4 gl4, TextureUtil texUtil, int unit)
      Binds this texture image to the texture unit.

      Calling this is not completely sufficient for totally binding an image to an image unit. Additionally, the image must be bound beforehand using GL.glBindTexture(int, int).

      Parameters:
      gl4 - GL4 implementation (not null)
      texUtil - utility used to convert JME's image format to the corresponding GL enum (not null)
      unit - texture unit to bind to
    • setUpdateNeeded

      public void setUpdateNeeded()
      Sets the update flag indicating this texture image needs rebinding.
    • clearUpdateNeeded

      public boolean clearUpdateNeeded()
      Clears the update flag and returns the update flag's value before it was cleared.
      Returns:
    • setTexture

      public void setTexture(Texture texture)
      Sets the underlying texture wrapped by this TextureImage.
      Parameters:
      texture - wrapped texture (not null)
    • setLevel

      public void setLevel(int level)
      Sets the image level to bind.

      The level controls which mipmap level will be bound to the texture unit, where zero corresponds to the base level of the texture.

      default=0

      Parameters:
      level - level to bind (not negative)
    • setLayer

      public void setLayer(int layer)
      Sets the image layer to bind.

      If the underlying texture is a one/two/three demensional array, cube map, cube map array, or two demensional multisample array, then this value specifies which layer of the array to bind.

      default=-1

      Parameters:
      layer - layer to bind, or negative to bind all layers
    • setAccess

      public void setAccess(TextureImage.Access access)
      Sets the shader access hint with which to bind the image.
      Parameters:
      access -
    • getTexture

      public Texture getTexture()
      Gets the underlying texture wrapped by this TextureImage.
      Returns:
      underlying texture
    • getImage

      public Image getImage()
      Gets the image belonging to the underlying texture.
      Returns:
    • getFormat

      public Image.Format getFormat()
      Gets the format of the image belonging to the underlying texture.
      Returns:
    • getImageId

      public int getImageId()
      Gets the native id of the image belonging to the underlying texture.
      Returns:
    • getLevel

      public int getLevel()
      Gets the level.
      Returns:
      See Also:
    • getLayer

      public int getLayer()
      Gets the layer.
      Returns:
      See Also:
    • getAccess

      public TextureImage.Access getAccess()
      Gets the access hint.
      Returns:
      See Also:
    • isLayered

      public boolean isLayered()
      Returns true if all layers of an image will be bound, when layer is negative.
      Returns:
      See Also:
    • isUpdateNeeded

      public boolean isUpdateNeeded()
      Returns true if the update flag has been set indicating rebinding is required.
      Returns: