Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

GraphicsDevice.Indices Property

Gets or sets index data.

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

public IndexBuffer Indices { get; set; }

Property Value

The index data.

Exception typeCondition
ObjectDisposedException Indices was called after this GraphicsDevice was disposed.

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 and associates a user-created vertex buffer of type VertexPositionNormalTexture with vertex stream 0 (zero) of the graphics device.

graphics.GraphicsDevice.Vertices[0].SetSource(
    vertexBuffer, 0,
    VertexPositionNormalTexture.SizeInBytes);

graphics.GraphicsDevice.Indices = lineListIndexBuffer;

Xbox 360, Windows XP SP2, Windows Vista

Community Additions

ADD
Show:
© 2015 Microsoft