IndexBuffer Constructor (GraphicsDevice, Type, Int32, ResourceUsage, ResourceManagementMode)
Initializes a new instance of the IndexBuffer class.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
public IndexBuffer (
GraphicsDevice graphicsDevice,
Type indexType,
int elementCount,
ResourceUsage usage,
ResourceManagementMode resourceManagementMode
)
Parameters
- graphicsDevice
The GraphicsDevice object to associate with the index buffer. - indexType
The type to use for index values. - elementCount
The number of values in the buffer. - usage
A set of options identifying the behaviors of this index buffer resource. It is good practice to match the usage parameter with the createOptions parameter in the GraphicsDevice constructor. If resourceManagementMode is ResourceManagementMode.Automatic, this value cannot be ResourceUsage.Dynamic. - resourceManagementMode
The memory management mode to use for this index buffer resource. If this value is ResourceManagementMode.Automatic, the runtime will recreate the resource when the graphics device is reset. If this value is ResourceManagementMode.Manual, this resource should be reinitialized when the graphics device is reset.
Exceptions
Exception type | Condition |
---|---|
ArgumentNullException | graphicsDevice is null. |
InvalidOperationException | Unable to create this IndexBuffer resource on the graphics device. |
See Also
Tasks
Reference
GraphicsDeviceManager.DeviceReset Event
IndexBuffer Class
IndexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista