LilyPath/DrawBatch.cs
/// <summary>
/// Adds a filled region enclosed by the given multisegment path to the batch of figures to be rendered.
/// </summary>
/// <param name="brush">The brush to render the shape with.</param>
/// <param name="points">The list of points that make up the multisegment path enclosing the region.</param>
/// <param name="offset">The offset into the <paramref name="points"/> list to begin rendering.</param>
/// <param name="count">The number of points that should be rendered, starting from <paramref name="offset"/>.</param>
/// <exception cref="InvalidOperationException"><c>FillPath</c> was called, but <see cref="Begin()"/> has not yet been called.</exception>
/// <remarks>Paths should be created with a clockwise winding order, or the resulting geometry will be backface-culled.</remarks>
Adds a filled region enclosed by the given multisegment path to the batch of figures to be rendered.
Adds a filled region enclosed by the given multisegment path to the batch of figures to be rendered .
public void FillPath (Brush brush, IList<Vector2> points, int offset, int count)
        {
            if (!_inDraw)
                throw new InvalidOperationException();
            if (brush == null)
                throw new ArgumentNullException("brush");
            if (_triangulator == null)
                _triangulator = new Triangulator();
            _triangulator.Triangulate(points, offset, count);
            RequestBufferSpace(count, _triangulator.ComputedIndexCount);
            AddInfo(PrimitiveType.TriangleList, count, _triangulator.ComputedIndexCount, brush);
            int baseVertexIndex = _vertexBufferIndex;
            for (int i = 0; i < count; i++) {
                AddVertex(points[offset + i], brush);
            }
            for (int i = 0; i < _triangulator.ComputedIndexCount; i++) {
                _indexBuffer[_indexBufferIndex + i] = (short)(_triangulator.ComputedIndexes[i] + baseVertexIndex);
            }
            _indexBufferIndex += _triangulator.ComputedIndexCount;
            if (_sortMode == DrawSortMode.Immediate)
                FlushBuffer();
        }
public void FillPath ( Brush brush , IList < Vector2 > points , int offset , int count ) { if ( ! _inDraw ) throw new InvalidOperationException ( ) ; if ( brush == null ) throw new ArgumentNullException ( " " ) ; if ( _triangulator == null ) _triangulator = new Triangulator ( ) ; _triangulator . Triangulate ( points , offset , count ) ; RequestBufferSpace ( count , _triangulator . ComputedIndexCount ) ; AddInfo ( PrimitiveType . TriangleList , count , _triangulator . ComputedIndexCount , brush ) ; int baseVertexIndex = _vertexBufferIndex ; for ( int i = 0 ; i < count ; i ++ ) { AddVertex ( points [ offset + i ] , brush ) ; } for ( int i = 0 ; i < _triangulator . ComputedIndexCount ; i ++ ) { _indexBuffer [ _indexBufferIndex + i ] = ( short ) ( _triangulator . ComputedIndexes [ i ] + baseVertexIndex ) ; } _indexBufferIndex += _triangulator . ComputedIndexCount ; if ( _sortMode == DrawSortMode . Immediate ) FlushBuffer ( ) ; }
Adds a filled region enclosed by the given multisegment path to the batch of figures to be rendered.
Adds a filled region enclosed by the given multisegment path to the batch of figures to be rendered .
FillPath has not yet been called.
FillPath has not yet been called .
brush
Brush
The brush to render the shape with.
The brush to render the shape with .
points
IList<Vector2>
The list of points that make up the multisegment path enclosing the region.
The list of points that make up the multisegment path enclosing the region .
offset
int
The offset into the  list to begin rendering.
The offset into the list to begin rendering .
count
int
The number of points that should be rendered, starting from .
The number of points that should be rendered starting from .
remarks
Paths should be created with a clockwise winding order, or the resulting geometry will be backface-culled.
Paths should be created with a clockwise winding order or the resulting geometry will be backface - culled .