MonoVision/Graphics/GraphicsDevice.cs
/// <summary>
/// Draw primitives of the specified type from the data in the given array of vertices without indexing.
/// </summary>
/// <typeparam name="T">The type of the vertices.</typeparam>
/// <param name="primitiveType">The type of primitives to draw with the vertices.</param>
/// <param name="vertexData">An array of vertices to draw.</param>
/// <param name="vertexOffset">The index in the array of the first vertex that should be rendered.</param>
/// <param name="primitiveCount">The number of primitives to draw.</param>
/// <param name="vertexDeclaration">The layout of the vertices.</param>
Draw primitives of the specified type from the data in the given array of vertices without indexing.
Draw primitives of the specified type from the data in the given array of vertices without indexing .
public void DrawUserPrimitives<T>(PrimitiveType primitiveType, T[] vertexData, int vertexOffset, int primitiveCount, VertexDeclaration vertexDeclaration) where T : struct
        {
            if (vertexData == null)
                throw new ArgumentNullException("vertexData");
            if (vertexData.Length == 0)
                throw new ArgumentOutOfRangeException("vertexData");
            if (vertexOffset < 0 || vertexOffset >= vertexData.Length)
                throw new ArgumentOutOfRangeException("vertexOffset");
            if (primitiveCount <= 0)
                throw new ArgumentOutOfRangeException("primitiveCount");
            var vertexCount = GetElementCountArray(primitiveType, primitiveCount);
            if (vertexOffset + vertexCount > vertexData.Length)
                throw new ArgumentOutOfRangeException("primitiveCount");
            if (vertexDeclaration == null)
                throw new ArgumentNullException("vertexDeclaration");
            PlatformDrawUserPrimitives<T>(primitiveType, vertexData, vertexOffset, vertexDeclaration, vertexCount);
            unchecked
            {
                _graphicsMetrics._drawCount++;
                _graphicsMetrics._primitiveCount += primitiveCount;
            }
        }
public void DrawUserPrimitives < T > ( PrimitiveType primitiveType , T [ ] vertexData , int vertexOffset , int primitiveCount , VertexDeclaration vertexDeclaration ) where T : struct { if ( vertexData == null ) throw new ArgumentNullException ( " " ) ; if ( vertexData . Length == 0 ) throw new ArgumentOutOfRangeException ( " " ) ; if ( vertexOffset < 0 || vertexOffset >= vertexData . Length ) throw new ArgumentOutOfRangeException ( " " ) ; if ( primitiveCount <= 0 ) throw new ArgumentOutOfRangeException ( " " ) ; var vertexCount = GetElementCountArray ( primitiveType , primitiveCount ) ; if ( vertexOffset + vertexCount > vertexData . Length ) throw new ArgumentOutOfRangeException ( " " ) ; if ( vertexDeclaration == null ) throw new ArgumentNullException ( " " ) ; PlatformDrawUserPrimitives < T > ( primitiveType , vertexData , vertexOffset , vertexDeclaration , vertexCount ) ; unchecked { _graphicsMetrics . _drawCount ++ ; _graphicsMetrics . _primitiveCount += primitiveCount ; } }
Draw primitives of the specified type from the data in the given array of vertices without indexing.
Draw primitives of the specified type from the data in the given array of vertices without indexing .
primitiveType
PrimitiveType
The type of primitives to draw with the vertices.
The type of primitives to draw with the vertices .
vertexData
T[]
An array of vertices to draw.
An array of vertices to draw .
vertexOffset
int
The index in the array of the first vertex that should be rendered.
The index in the array of the first vertex that should be rendered .
primitiveCount
int
The number of primitives to draw.
The number of primitives to draw .
vertexDeclaration
VertexDeclaration
The layout of the vertices.
The layout of the vertices .
typeparam
The type of the vertices.
The type of the vertices .