End() public method

The end is called once all the primitives have been drawn using AddVertex. It will call Flush to actually submit the draw call to the graphics card, and then tell the basic effect to end.
Begin must be called before End can be called.
public End ( ) : void
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;
            }
        }