public static class ModelCache.SimpleMeshPool extends 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
Mesh es 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.MeshPool
Mesh
es using the the ModelCache.MeshPool.obtain(VertexAttributes, int, int)
method.flush
in interface ModelCache.MeshPool
public Mesh obtain(VertexAttributes vertexAttributes, int vertexCount, int indexCount)
ModelCache.MeshPool
Mesh
that meets the specified criteria.obtain
in interface ModelCache.MeshPool
vertexAttributes
- 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()
Disposable
dispose
in interface Disposable
Copyright © 2018. All rights reserved.