Polyline in ImmediateMode gets updated even if not changed
Using the polyline example from the documentation in immediate mode generates a new mesh every frame. Even if I reuse the polyline object.
I "fixed" it by adding a meshDirty check in PolylinePath.TryUpdateMesh()
void TryUpdateMesh( bool closed, PolylineJoins joins ) {
lastUsedClosed = closed;
lastUsedJoins = joins;
// todo: be smarter about this, maybe don't mesh.clear but check point count and whatnot
if(meshDirty) {
ShapesMeshGen.GenPolylineMesh( base.mesh, path, closed, joins, flattenZ: false, useColors: true );
}
meshDirty = false;
}
Did I missed something?
ah heck good catch, actually just forgot to read the dirty flags! this has now been fixed in 3.2.2
the proper fix is to do this in DisposableMesh.cs, since this would also apply to polygons