GraphicsDevice.DrawUserIndexedPrimitives Generic Method (PrimitiveType, T[], Int32, Int32, Int16 , Int32, Int32)
Renders geometric primitives with indexed data specified by the user, specifying an index buffer as an array of type Int16.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
public void DrawUserIndexedPrimitives<T> (
PrimitiveType primitiveType,
T[] vertexData,
int vertexOffset,
int numVertices,
short[] indexData,
int indexOffset,
int primitiveCount
) where T : ValueType
Type Parameters
- T
The type of vertex in vertexData.
Parameters
- primitiveType
Describes the type of primitive to render. - vertexData
The vertex buffer indexed by indexData. - vertexOffset
Offset to add to each vertex index in the index buffer. - numVertices
Number of vertices used during this call. The first vertex is located at index minVertexIndex. - indexData
A list of indices into the vertex buffer, given in the order that you want the vertices to render. Using an array of type Int16, which uses 16 bits per element, allows you conserve resources if the index buffer does not require a 32-bit depth array. - indexOffset
Location in the index array at which to start reading vertices. - primitiveCount
Number of primitives to render. The maximum number of primitives allowed is determined by checking MaxPrimitiveCount. (The number of indices is a function of the primitive count and the primitive type.)
Exceptions
Exception type | Condition |
---|---|
ArgumentException | One of the following conditions is true:
|
ArgumentNullException | vertexData or indexData is null. |
ArgumentOutOfRangeException | One of the following conditions is true:
|
InvalidOperationException | One of the following conditions is true:
|
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista