Begin() public method

The begin.
End must be called before Begin can be called again. The specified primitiveType is not supported by PrimitiveBatch.
public Begin ( PrimitiveType primitiveType ) : void
primitiveType PrimitiveType The primitive type.
return void
Example #1
0
 public void Draw(Vector2 transform)
 {
     batch.Begin(PrimitiveType.LineList);
     foreach (var item in lines)
     {
         batch.AddVertex(item + transform, color);
     }
     batch.End();
 }
        public void Draw(Vector2 transform)
        {
            if (fill == false)
            {
                device.RasterizerState = state;
            }

            if (point.Count < 3)
            {
                throw new InvalidOperationException("precisa de 3 pontos pelo menos para poder desenhar os triangulos");
            }

            batch.Begin(PrimitiveType.TriangleStrip);
            foreach (var item in point)
            {
                batch.AddVertex(item + transform, color);
            }
            batch.End();

            if (fill == false)
            {
                device.RasterizerState = RasterizerState.CullCounterClockwise;
            }
        }