public static Mesh2D CreateRect(Rectangle rect, Vector2 texMin, Vector2 texMax) { var mesh = new Mesh2D(4, 6); mesh.AddRect(ref rect, texMin, texMax, Color4.White); mesh.Update(); return(mesh); }
public static Mesh2D CreateRect(Rectangle rect) { var mesh = new Mesh2D(4, 6); mesh.AddRect(ref rect, Vector2.Zero, Vector2.One, Color4.White); mesh.Update(); return(mesh); }
public void Flush() { if (mesh.IndexCount > 0) { mesh.Update(); draw.Perform(PrimitiveType.Triangles); mesh.Clear(); } }