Update placefile text data outside of render loop, polygon cleanup

This commit is contained in:
Dan Paulat 2023-08-19 21:43:57 -05:00
parent 8f2b87790a
commit b159540215
6 changed files with 60 additions and 36 deletions

View file

@ -233,11 +233,15 @@ void PlacefilePolygons::Deinitialize()
gl.glDeleteVertexArrays(1, &p->vao_);
gl.glDeleteBuffers(2, p->vbo_.data());
// Clear the current buffers
p->currentBuffer_.clear();
p->currentThresholdBuffer_.clear();
}
void PlacefilePolygons::StartPolygons()
{
// Clear the new buffer
// Clear the new buffers
p->newBuffer_.clear();
p->newThresholdBuffer_.clear();
}
@ -259,6 +263,10 @@ void PlacefilePolygons::FinishPolygons()
p->currentBuffer_.swap(p->newBuffer_);
p->currentThresholdBuffer_.swap(p->newThresholdBuffer_);
// Clear the new buffers
p->newBuffer_.clear();
p->newThresholdBuffer_.clear();
// Mark the draw item dirty
p->dirty_ = true;
}