Removed batch2d empty draw calls

This commit is contained in:
MihailRis 2023-12-14 18:52:49 +03:00
parent 128dade587
commit 04f06a4717

View File

@ -304,9 +304,11 @@ void Batch2D::sprite(float x, float y, float w, float h, int atlasRes, int index
}
void Batch2D::render(unsigned int gl_primitive) {
mesh->reload(buffer, index / B2D_VERTEX_SIZE);
mesh->draw(gl_primitive);
index = 0;
if (index == 0)
return;
mesh->reload(buffer, index / B2D_VERTEX_SIZE);
mesh->draw(gl_primitive);
index = 0;
}
void Batch2D::render() {