0 out of 1 rated this helpful - Rate this topic

IndexBuffer Class

Describes the rendering order of the vertices in a vertex buffer.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

public class IndexBuffer : GraphicsResource

The vertex stream and index data of the graphics device must be set before any call to DrawIndexedPrimitives. The following example sets the index data; it associates a user-created vertex buffer of type VertexPositionNormalTexture with vertex stream 0 (zero) of the graphics device.

// Initialize the vertex buffer, allocating memory for each vertex.
vertexBuffer = new VertexBuffer(graphics.GraphicsDevice, vertexDeclaration,
    points, BufferUsage.None);

// Set the vertex buffer data to the array of vertices.
vertexBuffer.SetData<VertexPositionColor>(pointList);
Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone 7
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.