Class TextureArray

java.lang.Object
dev.prozilla.pine.common.asset.image.TextureArray
All Implemented Interfaces:
Cloneable<TextureArray>, Destructible

public class TextureArray extends Object implements Cloneable<TextureArray>, Destructible
Represents a OpenGL Array Texture. An Array Texture contains multiple images of the same size.
  • Field Details

  • Constructor Details

    • TextureArray

      public TextureArray(int width, int height)
    • TextureArray

      public TextureArray(int width, int height, int layers)
  • Method Details

    • bind

      public void bind()
    • unbind

      public void unbind()
    • addLayer

      public TextureArrayLayer addLayer(String imagePath)
    • addLayer

      Adds a texture to this texture array in the next available layer.
      Throws:
      IllegalStateException - If all layers in this texture array are already being used.
      IllegalArgumentException - If the image has a different width or height than this texture array.
    • getLayer

      public TextureArrayLayer getLayer(Image image)
    • hasImage

      public boolean hasImage(Image image)
    • canAdd

      public boolean canAdd(Image image)
      Checks if a given image can be added to this texture array.
    • getId

      public int getId()
    • getWidth

      public int getWidth()
    • getHeight

      public int getHeight()
    • getLayers

      public Collection<TextureArrayLayer> getLayers()
    • getUsedLayerCount

      public int getUsedLayerCount()
    • getLayerCount

      public int getLayerCount()
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • equals

      public boolean equals(TextureArray textureArray)
      Description copied from interface: Cloneable
      Checks if the given object is equal to this object.
      Specified by:
      equals in interface Cloneable<TextureArray>
      Parameters:
      textureArray - Other object
      Returns:
      true if both objects are equal.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • clone

      public TextureArray clone()
      Description copied from interface: Cloneable
      Returns a new object that is equal to this object.
      Specified by:
      clone in interface Cloneable<TextureArray>
      Overrides:
      clone in class Object
      Returns:
      Clone of this object
    • destroy

      public void destroy()
      Removes this texture array from the resource pool and deletes it.
      Specified by:
      destroy in interface Destructible