Interface TextureBase
- All Superinterfaces:
Asset,Destructible
- All Known Implementing Classes:
Texture,TextureArrayLayer
Base class for different types of textures.
-
Method Summary
Modifier and TypeMethodDescriptionvoidbind()Binds this texture.default voiddestroy()Removes this texture from the resource pool and deletes it.getArray()intintgetId()getPath()Returns the path to the file this asset was loaded from.intgetWidth()booleanhasEqualLocation(TextureBase other) Checks whether two textures are from the same location.booleanvoidunbind()Unbinds this texture.
-
Method Details
-
bind
void bind()Binds this texture. -
unbind
void unbind()Unbinds this texture. -
hasEqualLocation
Checks whether two textures are from the same location.- Parameters:
other- Other texture- Returns:
- True if
otheris equal to this texture or in the same texture array.
-
getId
int getId() -
getWidth
int getWidth()- Returns:
- The width of this texture, in pixels.
-
getHeight
int getHeight()- Returns:
- The height of this texture, in pixels.
-
getPath
String getPath()Description copied from interface:AssetReturns the path to the file this asset was loaded from. -
destroy
default void destroy()Removes this texture from the resource pool and deletes it.- Specified by:
destroyin interfaceAsset- Specified by:
destroyin interfaceDestructible
-
isInArray
boolean isInArray()- Returns:
- True if this texture is part of a texture array.
-
getArray
TextureArray getArray()- Returns:
- The texture array this texture is part of, or
nullif this texture is not in a texture array.
-