Class TextureArray
java.lang.Object
dev.prozilla.pine.common.system.resource.image.TextureArray
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.void
destroy()
Removes this texture array from the resource pool and deletes it.boolean
equals
(TextureArray other) 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
-
hashCode
public int hashCode() -
destroy
public void destroy()Removes this texture array from the resource pool and deletes it.
-