Interface TextureBase

All Superinterfaces:
Asset, Destructible
All Known Implementing Classes:
Texture, TextureArrayLayer

public interface TextureBase extends Asset
Base class for different types of textures.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Binds this texture.
    default void
    Removes this texture from the resource pool and deletes it.
     
    int
     
    int
     
    Returns the path to the file this asset was loaded from.
    int
     
    boolean
    Checks whether two textures are from the same location.
    boolean
     
    void
    Unbinds this texture.
  • Method Details

    • bind

      void bind()
      Binds this texture.
    • unbind

      void unbind()
      Unbinds this texture.
    • hasEqualLocation

      boolean hasEqualLocation(TextureBase other)
      Checks whether two textures are from the same location.
      Parameters:
      other - Other texture
      Returns:
      True if other is equal to this texture or in the same texture array.
    • getId

      int getId()
    • getWidth

      int getWidth()
      Returns:
      The width of this texture, in pixels.
    • getHeight

      int getHeight()
      Returns:
      The height of this texture, in pixels.
    • getPath

      String getPath()
      Description copied from interface: Asset
      Returns the path to the file this asset was loaded from.
      Specified by:
      getPath in interface Asset
      Returns:
      The path of the image file of this texture.
    • destroy

      default void destroy()
      Removes this texture from the resource pool and deletes it.
      Specified by:
      destroy in interface Asset
      Specified by:
      destroy in interface Destructible
    • isInArray

      boolean isInArray()
      Returns:
      True if this texture is part of a texture array.
    • getArray

      TextureArray getArray()
      Returns:
      The texture array this texture is part of, or null if this texture is not in a texture array.