IndexBuffer Constructor (GraphicsDevice, Type, Int32, BufferUsage)
Initializes a new instance of the IndexBuffer class.
Syntax
'Declaration
Public Sub New ( _
graphicsDevice As GraphicsDevice, _
indexType As Type, _
indexCount As Integer, _
usage As BufferUsage _
)
public IndexBuffer (
GraphicsDevice graphicsDevice,
Type indexType,
int indexCount,
BufferUsage usage
)
public:
IndexBuffer(
GraphicsDevice graphicsDevice,
Type indexType,
int indexCount,
BufferUsage usage
)
Parameters
- graphicsDevice
Type: GraphicsDevice
The GraphicsDevice object to associate with the index buffer. - indexType
Type: Type
The index value type. - indexCount
Type: Int32
The number of indices. - usage
Type: BufferUsage
Behavior options.
Exceptions
Exception type | Condition |
---|---|
ArgumentNullException | graphicsDevice is null. |
ArgumentOutOfRangeException | The elementCount parameter is invalid. Index buffers can only be created for indices which are sixteen or thirty-two bits in length. |
NotSupportedException | The profile does not support an elementSize of IndexElementSize.ThirtyTwoBits; use IndexElementSize.SixteenBits or a type that has a size of two bytes. |
OutOfMemoryException | There is not enough memory to create this resource. |
Requirements
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)
See Also
Reference
GraphicsDeviceManager.DeviceReset Event
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Windows Phone