Class TextureArray
java.lang.Object
dev.prozilla.pine.common.asset.image.TextureArray
- All Implemented Interfaces:
Cloneable<TextureArray>,Destructible
Represents a OpenGL Array Texture.
An Array Texture contains multiple images of the same size.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTextureArray(int width, int height) TextureArray(int width, int height, int layers) -
Method Summary
Modifier and TypeMethodDescriptionAdds a texture to this texture array in the next available layer.voidbind()booleanChecks if a given image can be added to this texture array.clone()Returns a new object that is equal to this object.voiddestroy()Removes this texture array from the resource pool and deletes it.booleanequals(TextureArray textureArray) Checks if the given object is equal to this object.booleanintintgetId()intintintgetWidth()inthashCode()booleanvoidunbind()
-
Field Details
-
DEFAULT_LAYER_COUNT
public static final int DEFAULT_LAYER_COUNT- See Also:
-
-
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
-
addLayer
public TextureArrayLayer addLayer(Image image) throws IllegalStateException, IllegalArgumentException 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
-
hasImage
-
canAdd
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
-
getUsedLayerCount
public int getUsedLayerCount() -
getLayerCount
public int getLayerCount() -
equals
-
equals
Description copied from interface:CloneableChecks if the given object is equal to this object.- Specified by:
equalsin interfaceCloneable<TextureArray>- Parameters:
textureArray- Other object- Returns:
trueif both objects are equal.
-
hashCode
public int hashCode() -
clone
Description copied from interface:CloneableReturns a new object that is equal to this object.- Specified by:
clonein interfaceCloneable<TextureArray>- Overrides:
clonein classObject- Returns:
- Clone of this object
-
destroy
public void destroy()Removes this texture array from the resource pool and deletes it.- Specified by:
destroyin interfaceDestructible
-