示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
 public void Flush()
 {
     if (mesh.IndexCount > 0)
     {
         mesh.Update();
         draw.Perform(PrimitiveType.Triangles);
         mesh.Clear();
     }
 }