GraphicsDevice.DrawUserIndexedPrimitives Generic Method (PrimitiveType, T[], Int32, Int32, Int16 , Int32, Int32, VertexDeclaration)
Renders indexed primitives from a 16-bit index buffer, a vertex declaration, and other related input parameters.
Syntax
'Declaration
Public Sub DrawUserIndexedPrimitives(Of T As Struct) ( _
primitiveType As PrimitiveType, _
vertexData As T(), _
vertexOffset As Integer, _
numVertices As Integer, _
indexData As Short(), _
indexOffset As Integer, _
primitiveCount As Integer, _
vertexDeclaration As VertexDeclaration _
)
public void DrawUserIndexedPrimitives<T> (
PrimitiveType primitiveType,
T[] vertexData,
int vertexOffset,
int numVertices,
short[] indexData,
int indexOffset,
int primitiveCount,
VertexDeclaration vertexDeclaration
) where T : struct
public:
generic<typename T> where T : struct
void DrawUserIndexedPrimitives(
PrimitiveType primitiveType,
T vertexData[],
int vertexOffset,
int numVertices,
short indexData[],
int indexOffset,
int primitiveCount,
VertexDeclaration vertexDeclaration
)
Type Parameters
- T
Per-vertex data type.
Parameters
- primitiveType
Type: PrimitiveType
The primitive type. - vertexData
Type: T
The vertex data. - vertexOffset
Type: Int32
Offset (in vertices) from the beginning of the vertex buffer to the first vertex to draw. - numVertices
Type: Int32
Number of vertices to draw. - indexData
Type: Int16
The index data. - indexOffset
Type: Int32
Offset (in indices) from the beginning of the index buffer to the first index to use. - primitiveCount
Type: Int32
Number of primitives to render. - vertexDeclaration
Type: VertexDeclaration
The vertex declaration.
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:
|
NotSupportedException | The profile does not support an elementSize of IndexElementSize.ThirtyTwoBits; use IndexElementSize.SixteenBits or a type that has a size of two bytes. |
Requirements
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)
See Also
Reference
GraphicsDevice Class
GraphicsDevice Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Windows Phone