LilyPath/DrawBatch.cs
/// <summary>
/// Adds a filled ellipse to the batch of figures to be rendered.
/// </summary>
/// <param name="brush">The brush to render the shape with.</param>
/// <param name="center">The center coordinate of the ellipse.</param>
/// <param name="xRadius">The radius of the ellipse along the x-axis.</param>
/// <param name="yRadius">The radius of the llipse along the y-axis.</param>
/// <param name="angle">The angle to rotate the ellipse by in radians.  Positive values rotate clockwise.</param>
/// <param name="subdivisions">The number of subdivisions to render the circle with.</param>
/// <exception cref="InvalidOperationException"><c>FillEllipse</c> was called, but <see cref="Begin()"/> has not yet been called.</exception>
Adds a filled ellipse to the batch of figures to be rendered.
Adds a filled ellipse to the batch of figures to be rendered .
public void FillEllipse (Brush brush, Vector2 center, float xRadius, float yRadius, float angle, int subdivisions)
        {
            if (!_inDraw)
                throw new InvalidOperationException();
            if (brush == null)
                throw new ArgumentNullException("brush");
            RequestBufferSpace(subdivisions + 1, subdivisions * 3);
            AddInfo(PrimitiveType.TriangleList, subdivisions + 1, subdivisions * 3, brush);
            BuildEllipseGeometryBuffer(center, xRadius, yRadius, angle, subdivisions);
            int baseVertexIndex = _vertexBufferIndex;
            for (int i = 0; i < subdivisions; i++)
                AddVertex(_geometryBuffer[i], brush);
            AddVertex(new Vector2(center.X, center.Y), brush);
            for (int i = 0; i < subdivisions - 1; i++)
                AddTriangle(baseVertexIndex + subdivisions, baseVertexIndex + i + 1, baseVertexIndex + i);
            AddTriangle(baseVertexIndex + subdivisions, baseVertexIndex, baseVertexIndex + subdivisions - 1);
            if (_sortMode == DrawSortMode.Immediate)
                FlushBuffer();
        }
public void FillEllipse ( Brush brush , Vector2 center , float xRadius , float yRadius , float angle , int subdivisions ) { if ( ! _inDraw ) throw new InvalidOperationException ( ) ; if ( brush == null ) throw new ArgumentNullException ( " " ) ; RequestBufferSpace ( subdivisions + 1 , subdivisions * 3 ) ; AddInfo ( PrimitiveType . TriangleList , subdivisions + 1 , subdivisions * 3 , brush ) ; BuildEllipseGeometryBuffer ( center , xRadius , yRadius , angle , subdivisions ) ; int baseVertexIndex = _vertexBufferIndex ; for ( int i = 0 ; i < subdivisions ; i ++ ) AddVertex ( _geometryBuffer [ i ] , brush ) ; AddVertex ( new Vector2 ( center . X , center . Y ) , brush ) ; for ( int i = 0 ; i < subdivisions - 1 ; i ++ ) AddTriangle ( baseVertexIndex + subdivisions , baseVertexIndex + i + 1 , baseVertexIndex + i ) ; AddTriangle ( baseVertexIndex + subdivisions , baseVertexIndex , baseVertexIndex + subdivisions - 1 ) ; if ( _sortMode == DrawSortMode . Immediate ) FlushBuffer ( ) ; }
Adds a filled ellipse to the batch of figures to be rendered.
Adds a filled ellipse to the batch of figures to be rendered .
FillEllipse has not yet been called.
FillEllipse has not yet been called .
brush
Brush
The brush to render the shape with.
The brush to render the shape with .
center
Vector2
The center coordinate of the ellipse.
The center coordinate of the ellipse .
xRadius
float
The radius of the ellipse along the x-axis.
The radius of the ellipse along the x - axis .
yRadius
float
The radius of the llipse along the y-axis.
The radius of the llipse along the y - axis .
angle
float
The angle to rotate the ellipse by in radians.  Positive values rotate clockwise.
The angle to rotate the ellipse by in radians . Positive values rotate clockwise .
subdivisions
int
The number of subdivisions to render the circle with.
The number of subdivisions to render the circle with .