java.lang.Object
dev.prozilla.pine.common.system.resource.image.TextureArray

public class TextureArray extends Object
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(TextureArray other)
    • hashCode

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

      public void destroy()
      Removes this texture array from the resource pool and deletes it.