public static class ModelCache.SimpleMeshPool extends java.lang.Object implements ModelCache.MeshPool
ModelCache.MeshPool implementation that avoids creating new meshes at the cost of memory usage. It does this by making
the mesh always the maximum (32k) size. Use this when for dynamic caching where you need to obtain meshes very frequently
(typically every frame).| Constructor and Description |
|---|
SimpleMeshPool() |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Releases all resources of this object.
|
void |
flush()
Releases all previously obtained
Meshes using the the ModelCache.MeshPool.obtain(VertexAttributes, int, int) method. |
Mesh |
obtain(VertexAttributes vertexAttributes,
int vertexCount,
int indexCount)
Will try to reuse or, when not possible to reuse, optionally create a
Mesh that meets the specified criteria. |
public void flush()
ModelCache.MeshPoolMeshes using the the ModelCache.MeshPool.obtain(VertexAttributes, int, int) method.flush in interface ModelCache.MeshPoolpublic Mesh obtain(VertexAttributes vertexAttributes, int vertexCount, int indexCount)
ModelCache.MeshPoolMesh that meets the specified criteria.obtain in interface ModelCache.MeshPoolvertexAttributes - the vertex attributes of the mesh to obtainvertexCount - the minimum amount vertices the mesh should be able to storeindexCount - the minimum amount of indices the mesh should be able to storepublic void dispose()
Disposabledispose in interface Disposable