MonoGame.Framework/Graphics/GraphicsDevice.cs
/// <summary>
/// Draw geometry by indexing into the vertex buffer.
/// </summary>
/// <param name="primitiveType">The type of primitives in the index buffer.</param>
/// <param name="baseVertex">Used to offset the vertex range indexed from the vertex buffer.</param>
/// <param name="startIndex">The index within the index buffer to start drawing from.</param>
/// <param name="primitiveCount">The number of primitives to render from the index buffer.</param>
Draw geometry by indexing into the vertex buffer.
Draw geometry by indexing into the vertex buffer .
public void DrawIndexedPrimitives(PrimitiveType primitiveType, int baseVertex, int startIndex, int primitiveCount)
        {
            if (_vertexShader == null)
                throw new InvalidOperationException("Vertex shader must be set before calling DrawIndexedPrimitives.");
            if (_vertexBuffers.Count == 0)
                throw new InvalidOperationException("Vertex buffer must be set before calling DrawIndexedPrimitives.");
            if (_indexBuffer == null)
                throw new InvalidOperationException("Index buffer must be set before calling DrawIndexedPrimitives.");
            if (primitiveCount <= 0)
                throw new ArgumentOutOfRangeException("primitiveCount");
            PlatformDrawIndexedPrimitives(primitiveType, baseVertex, startIndex, primitiveCount);
            unchecked
            {
                _graphicsMetrics._drawCount++;
                _graphicsMetrics._primitiveCount += primitiveCount;
            }
        }
public void DrawIndexedPrimitives ( PrimitiveType primitiveType , int baseVertex , int startIndex , int primitiveCount ) { if ( _vertexShader == null ) throw new InvalidOperationException ( " " ) ; if ( _vertexBuffers . Count == 0 ) throw new InvalidOperationException ( " " ) ; if ( _indexBuffer == null ) throw new InvalidOperationException ( " " ) ; if ( primitiveCount <= 0 ) throw new ArgumentOutOfRangeException ( " " ) ; PlatformDrawIndexedPrimitives ( primitiveType , baseVertex , startIndex , primitiveCount ) ; unchecked { _graphicsMetrics . _drawCount ++ ; _graphicsMetrics . _primitiveCount += primitiveCount ; } }
Draw geometry by indexing into the vertex buffer.
Draw geometry by indexing into the vertex buffer .
primitiveType
PrimitiveType
The type of primitives in the index buffer.
The type of primitives in the index buffer .
baseVertex
int
Used to offset the vertex range indexed from the vertex buffer.
Used to offset the vertex range indexed from the vertex buffer .
startIndex
int
The index within the index buffer to start drawing from.
The index within the index buffer to start drawing from .
primitiveCount
int
The number of primitives to render from the index buffer.
The number of primitives to render from the index buffer .