DynamicVertexBuffer Constructor (GraphicsDevice, Int32, BufferUsage)
Initializes a new instance of DynamicVertexBuffer with the specified parameters.
Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)
Syntax
public DynamicVertexBuffer (
GraphicsDevice graphicsDevice,
int sizeInBytes,
BufferUsage usage
)
Parameters
- graphicsDevice
The graphics device to associate with this vertex buffer. - sizeInBytes
The number of bytes to allocate for this vertex buffer resource. - usage
A set of options identifying the behaviors of this vertex buffer resource. It is good practice to match the usage parameter with the createOptions parameter in the GraphicsDevice constructor.
Exceptions
Exception type | Condition |
---|---|
ArgumentNullException | The graphicsDevice must not be null when creating new resources. |
ArgumentOutOfRangeException | sizeInBytes must be greater than zero. |
InvalidOperationException | This resource could not be created. |
See Also
Reference
DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace
Platforms
Xbox 360, Windows XP SP2, Windows Vista