public interface GpuResourceCache
| Modifier and Type | Field and Description |
|---|---|
static String |
DISPLAY_LISTS
Identifies resources as Display List IDs.
|
static String |
TEXTURE
Identifies resources as textures.
|
static String |
VBO_BUFFERS
Identifies resources as Vertex Buffer IDs.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all entries from this cache.
|
boolean |
contains(Object key)
Indicates whether a resource is in the cache.
|
Object |
get(Object key)
Finds and returns a resource from this cache.
|
long |
getCapacity()
Indicates this cache's capacity in bytes.
|
long |
getFreeCapacity()
Indicates this cache's memory capacity not used by its cached objects.
|
long |
getLowWater()
Indicates the cache's low water size.
|
int |
getNumObjects()
Indicates the number of resources in this cache.
|
Texture |
getTexture(Object key)
Finds and returns a texture resource from this cache.
|
long |
getUsedCapacity()
Indicates the amount of memory used by cached objects in this cache.
|
void |
put(Object key,
Object resource,
String resourceType,
long size)
Adds a new resource to this cache.
|
void |
put(Object key,
Texture texture)
Add a resource to this cache.
|
void |
remove(Object key)
Removes a resource from this cache.
|
void |
setCapacity(long newCapacity)
Specifies this cache's capacity, the amount of memory the cache manages.
|
void |
setLowWater(long loWater)
Specifies the low water size for this cache.
|
static final String DISPLAY_LISTS
static final String TEXTURE
Texture.static final String VBO_BUFFERS
void clear()
boolean contains(Object key)
key - the resource's key.Object get(Object key)
key - the resource's key.IllegalArgumentException - if the key is null.long getCapacity()
long getFreeCapacity()
getCapacity()long getLowWater()
setLowWater(long)int getNumObjects()
Texture getTexture(Object key)
key - the texture resource's key.IllegalArgumentException - if the key is null.long getUsedCapacity()
getCapacity()void put(Object key, Object resource, String resourceType, long size)
key - the key identifying the resource.resource - the resource cached.resourceType - the type of resource, one of the resource-type constants described above.size - the size of the resource, expressed as the number of bytes it requires on the GPU.put(Object, com.jogamp.opengl.util.texture.Texture)void put(Object key, Texture texture)
key - the key identifying the resource.texture - the resource to add to this cache.IllegalArgumentException - if either argument is null.void remove(Object key)
key - the resource's key.IllegalArgumentException - if the key is null.void setCapacity(long newCapacity)
newCapacity - the number of bytes allowed for the cache's resources. Values less than or equal to 0 are
ignored and cause no change to this cache's capacity.setLowWater(long)void setLowWater(long loWater)
loWater - the size to reduce this cache to when added resources would exceed the cache's capacity. Values
less than or equal to 0 are ignored and cause no change to this cache's low water size.setCapacity(long),
remove(Object)