LilyPath/DrawBatch.cs
/// <summary>
/// Computes and adds a line segment path to the batch of figures to be rendered.
/// </summary>
/// <param name="pen">The pen to render the path with.</param>
/// <param name="p0">The first point of the line segment.</param>
/// <param name="p1">The second point of the line segment.</param>
/// <exception cref="InvalidOperationException"><c>DrawLine</c> was called, but <see cref="Begin()"/> has not yet been called.</exception>
Computes and adds a line segment path to the batch of figures to be rendered.
Computes and adds a line segment path to the batch of figures to be rendered .
public void DrawLine (Pen pen, Vector2 p0, Vector2 p1)
        {
            if (!_inDraw)
                throw new InvalidOperationException();
            if (pen == null)
                throw new ArgumentNullException("pen");
            RequestBufferSpace(4, 6);
            _ws.ResetWorkspace(pen);
            if (pen.NeedsPathLength)
                _ws.PathLength = Vector2.Distance(p0, p1);
            AddInfo(PrimitiveType.TriangleList, 4, 6, pen.Brush);
            int baseVertexIndex = _vertexBufferIndex;
            AddStartPoint(p0, p1, pen, _ws);
            AddEndPoint(p0, p1, pen, _ws);
            AddSegment(baseVertexIndex + 0, baseVertexIndex + 2);
            if (_sortMode == DrawSortMode.Immediate)
                FlushBuffer();
        }
public void DrawLine ( Pen pen , Vector2 p0 , Vector2 p1 ) { if ( ! _inDraw ) throw new InvalidOperationException ( ) ; if ( pen == null ) throw new ArgumentNullException ( " " ) ; RequestBufferSpace ( 4 , 6 ) ; _ws . ResetWorkspace ( pen ) ; if ( pen . NeedsPathLength ) _ws . PathLength = Vector2 . Distance ( p0 , p1 ) ; AddInfo ( PrimitiveType . TriangleList , 4 , 6 , pen . Brush ) ; int baseVertexIndex = _vertexBufferIndex ; AddStartPoint ( p0 , p1 , pen , _ws ) ; AddEndPoint ( p0 , p1 , pen , _ws ) ; AddSegment ( baseVertexIndex + 0 , baseVertexIndex + 2 ) ; if ( _sortMode == DrawSortMode . Immediate ) FlushBuffer ( ) ; }
Computes and adds a line segment path to the batch of figures to be rendered.
Computes and adds a line segment path to the batch of figures to be rendered .
DrawLine has not yet been called.
DrawLine has not yet been called .
pen
Pen
The pen to render the path with.
The pen to render the path with .
p0
Vector2
The first point of the line segment.
The first point of the line segment .
p1
Vector2
The second point of the line segment.
The second point of the line segment .