Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

GraphicsDevice.DrawInstancedPrimitives Method

Draws a series of instanced models.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in

public void DrawInstancedPrimitives (
         PrimitiveType primitiveType,
         int baseVertex,
         int minVertexIndex,
         int numVertices,
         int startIndex,
         int primitiveCount,
         int instanceCount


Type: PrimitiveType
The primitive type.
Type: Int32
Offset to add to each vertex index in the index buffer.
Type: Int32
Minimum vertex index for vertices used during the call. The minVertexIndex parameter and all of the indices in the index stream are relative to the baseVertex parameter.
Type: Int32
Number of vertices used during the call. The first vertex is located at index: baseVertex + minVertexIndex.
Type: Int32
Location in the index array at which to start reading vertices.
Type: Int32
Number of primitives to render. The number of vertices used is a function of primitiveCount and primitiveType.
Type: Int32
Number of primitives to render.

Exception typeCondition
NotImplementedException This method is not implemented for Windows Phone, which does not support instancing.

This method provides a mechanism for gathering vertex shader input data from different streams at different frequencies (typically by interpreting one data stream as a per-instance world transform); this approach requires a custom shader to interpret the input data. For more information, see DrawInstancedPrimitives in XNA Game Studio 4.0.

Cited Works

"DrawInstancedPrimitives in XNA Game Studio 4.0." Shawn Hargreaves Blog. June 2010.

Xbox 360, Windows 7, Windows Vista, Windows XP

Community Additions

© 2017 Microsoft