Package com.badlogic.gdx.graphics.g3d
Interface ModelCache.MeshPool
-
- All Superinterfaces:
Disposable
- All Known Implementing Classes:
ModelCache.SimpleMeshPool
,ModelCache.TightMeshPool
- Enclosing class:
- ModelCache
public static interface ModelCache.MeshPool extends Disposable
Allows to reuse one or more meshes while avoiding creating new objects. Depending on the implementation it might add memory optimizations as well. Call theobtain(VertexAttributes, int, int)
method to obtain a mesh which can at minimum the specified amount of vertices and indices. Call theflush()
method to flush the pool ant release all previously obtained meshes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
flush()
Releases all previously obtainedMesh
es using the theobtain(VertexAttributes, int, int)
method.Mesh
obtain(VertexAttributes vertexAttributes, int vertexCount, int indexCount)
Will try to reuse or, when not possible to reuse, optionally create aMesh
that meets the specified criteria.-
Methods inherited from interface com.badlogic.gdx.utils.Disposable
dispose
-
-
-
-
Method Detail
-
obtain
Mesh obtain(VertexAttributes vertexAttributes, int vertexCount, int indexCount)
Will try to reuse or, when not possible to reuse, optionally create aMesh
that meets the specified criteria.- Parameters:
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 store- Returns:
- the obtained Mesh, or null when no mesh could be obtained.
-
flush
void flush()
Releases all previously obtainedMesh
es using the theobtain(VertexAttributes, int, int)
method.
-
-