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 Summary
ConstructorsConstructorDescriptionTextureDescriptor(int width, int height, TextureFormat format) Backward-compatible 3-arg constructor — defaults to AUTO mips for color, NONE for depth.TextureDescriptor(int width, int height, TextureFormat format, MipMode mipMode) Backward-compatible 2D constructor (4 args).TextureDescriptor(TextureType type, int width, int height, int depth, int layers, TextureFormat format, MipMode mipMode) Creates an instance of aTextureDescriptorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic TextureDescriptorcubeMap(int size, TextureFormat format) Cube map texture (6 layers, square faces).intdepth()Returns the value of thedepthrecord component.static TextureDescriptordepth(int width, int height) Depth texture with NONE mips.final booleanIndicates whether some other object is "equal to" this one.format()Returns the value of theformatrecord component.final inthashCode()Returns a hash code value for this object.intheight()Returns the value of theheightrecord component.intlayers()Returns the value of thelayersrecord component.mipMode()Returns the value of themipModerecord component.static TextureDescriptorrgba(int width, int height) RGBA8 with AUTO mips.static TextureDescriptortexture2dArray(int width, int height, int layers, TextureFormat format) 2D array texture with the given number of layers.static TextureDescriptortexture3d(int width, int height, int depth, TextureFormat format) 3D volume texture.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.intwidth()Returns the value of thewidthrecord component.withMipMode(MipMode mode) Creates a copy with a different MipMode.
-
Constructor Details
-
TextureDescriptor
Backward-compatible 2D constructor (4 args). -
TextureDescriptor
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 aTextureDescriptorrecord class.- Parameters:
type- the value for thetyperecord componentwidth- the value for thewidthrecord componentheight- the value for theheightrecord componentdepth- the value for thedepthrecord componentlayers- the value for thelayersrecord componentformat- the value for theformatrecord componentmipMode- the value for themipModerecord component
-
-
Method Details
-
rgba
RGBA8 with AUTO mips. -
depth
Depth texture with NONE mips. -
texture3d
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
Cube map texture (6 layers, square faces). -
withMipMode
Creates a copy with a different MipMode. -
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
width
public int width()Returns the value of thewidthrecord component.- Returns:
- the value of the
widthrecord component
-
height
public int height()Returns the value of theheightrecord component.- Returns:
- the value of the
heightrecord component
-
depth
public int depth()Returns the value of thedepthrecord component.- Returns:
- the value of the
depthrecord component
-
layers
public int layers()Returns the value of thelayersrecord component.- Returns:
- the value of the
layersrecord component
-
format
Returns the value of theformatrecord component.- Returns:
- the value of the
formatrecord component
-
mipMode
Returns the value of themipModerecord component.- Returns:
- the value of the
mipModerecord component
-