DynamicIndexBuffer Constructor (GraphicsDevice, Type, Int32, BufferUsage)

Initializes a new instance of DynamicIndexBuffer with the specified parameters.

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

Syntax

public DynamicIndexBuffer (
         GraphicsDevice graphicsDevice,
         Type indexType,
         int elementCount,
         BufferUsage usage
)

Parameters

  • graphicsDevice
    The associated graphics device of the index buffer.
  • indexType
    Type to use for index values.
  • elementCount
    Number of indices in the buffer.
  • usage
    A set of options identifying the behaviors of this index buffer resource.

Exceptions

Exception type Condition
ArgumentNullException graphicsDevice is null.
ArgumentOutOfRangeException The elementCount parameter is invalid. It must be greater than zero, and the index must be sixteen or thirty-two bits in length. Index buffers can only be created for indices which are sixteen or thirty-two bits in length.
InvalidOperationException This resource could not be created.

See Also

Reference

DynamicIndexBuffer Class
DynamicIndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Platforms

Xbox 360, Windows XP SP2, Windows Vista