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.void
bind()
boolean
Checks if a given image can be added to this texture array.clone()
Returns a new object that is equal to this object.void
destroy()
Removes this texture array from the resource pool and deletes it.boolean
equals
(TextureArray textureArray) Checks if the given object is equal to this object.boolean
int
int
getId()
int
int
int
getWidth()
int
hashCode()
boolean
void
unbind()
-
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:Cloneable
Checks if the given object is equal to this object.- Specified by:
equals
in interfaceCloneable<TextureArray>
- Parameters:
textureArray
- Other object- Returns:
true
if both objects are equal.
-
hashCode
public int hashCode() -
clone
Description copied from interface:Cloneable
Returns a new object that is equal to this object.- Specified by:
clone
in interfaceCloneable<TextureArray>
- Overrides:
clone
in classObject
- Returns:
- Clone of this object
-
destroy
public void destroy()Removes this texture array from the resource pool and deletes it.- Specified by:
destroy
in interfaceDestructible
-