Added example buffer function.

This commit is contained in:
2023-12-06 09:15:38 -06:00
parent 3c31c2872d
commit a40874ceee
4 changed files with 94 additions and 8 deletions

View File

@ -16,6 +16,12 @@ void Mesh::createBuffers(
assertTrue(verticeCount > 0, "Vertice count must be greater than zero.");
assertTrue(indiceCount > 0, "Indice count must be greater than zero.");
// Can we re-use the buffers?
if(
verticeCount <= this->verticeCount &&
indiceCount <= this->indiceCount
) return;
this->disposeBuffers();
this->verticeCount = verticeCount;