Record Class TextureDescriptor

java.lang.Object
java.lang.Record
dev.engine.graphics.texture.TextureDescriptor

public record TextureDescriptor(TextureType type, int width, int height, int depth, int layers, TextureFormat format, MipMode mipMode) extends Record
  • Constructor Details

    • TextureDescriptor

      public TextureDescriptor(int width, int height, TextureFormat format, MipMode mipMode)
      Backward-compatible 2D constructor (4 args).
    • TextureDescriptor

      public TextureDescriptor(int width, int height, TextureFormat format)
      Backward-compatible 3-arg constructor — defaults to AUTO mips for color, NONE for depth.
    • TextureDescriptor

      public TextureDescriptor(TextureType type, int width, int height, int depth, int layers, TextureFormat format, MipMode mipMode)
      Creates an instance of a TextureDescriptor record class.
      Parameters:
      type - the value for the type record component
      width - the value for the width record component
      height - the value for the height record component
      depth - the value for the depth record component
      layers - the value for the layers record component
      format - the value for the format record component
      mipMode - the value for the mipMode record component
  • Method Details

    • rgba

      public static TextureDescriptor rgba(int width, int height)
      RGBA8 with AUTO mips.
    • depth

      public static TextureDescriptor depth(int width, int height)
      Depth texture with NONE mips.
    • texture3d

      public static TextureDescriptor texture3d(int width, int height, int depth, TextureFormat format)
      3D volume texture.
    • texture2dArray

      public static TextureDescriptor texture2dArray(int width, int height, int layers, TextureFormat format)
      2D array texture with the given number of layers.
    • cubeMap

      public static TextureDescriptor cubeMap(int size, TextureFormat format)
      Cube map texture (6 layers, square faces).
    • withMipMode

      public TextureDescriptor withMipMode(MipMode mode)
      Creates a copy with a different MipMode.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • type

      public TextureType type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • width

      public int width()
      Returns the value of the width record component.
      Returns:
      the value of the width record component
    • height

      public int height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component
    • depth

      public int depth()
      Returns the value of the depth record component.
      Returns:
      the value of the depth record component
    • layers

      public int layers()
      Returns the value of the layers record component.
      Returns:
      the value of the layers record component
    • format

      public TextureFormat format()
      Returns the value of the format record component.
      Returns:
      the value of the format record component
    • mipMode

      public MipMode mipMode()
      Returns the value of the mipMode record component.
      Returns:
      the value of the mipMode record component