Class TextureAllocator
java.lang.Object
dev.pfaff.altargui.texture.TextureAllocator
- All Implemented Interfaces:
AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
The minimum allocation size in pixels. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
MAX_TEXTURE_SIZE
public static final int MAX_TEXTURE_SIZE -
UNIT
public static final int UNITThe minimum allocation size in pixels. Herein we often measure in "units" rather than pixels for efficiency.
-
-
Constructor Details
-
TextureAllocator
public TextureAllocator(int size, int initialLayers) - Parameters:
size
- the width and height of each layer.
-
-
Method Details
-
reset
public void reset() -
bound
-
alloc
Gets a shader to the given texture. If not loaded, the texture will be loaded and a slot allocated for it. -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
dump
public void dump()
-