VertexBuffer Constructor (GraphicsDevice, VertexDeclaration, Int32, BufferUsage)

Creates an instance of this object.

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

public VertexBuffer (
         GraphicsDevice graphicsDevice,
         VertexDeclaration vertexDeclaration,
         int vertexCount,
         BufferUsage usage
)

Parameters

graphicsDevice
Type: GraphicsDevice
The graphics device.
vertexDeclaration
Type: VertexDeclaration
The vertex declaration, which describes per-vertex data.
vertexCount
Type: Int32
The number of vertices.
usage
Type: BufferUsage
Behavior options; it is good practice for this to match the createOptions parameter in the GraphicsDevice constructor.

Exception typeCondition
OutOfMemoryExceptionThere is not enough memory to create this resource.

Xbox 360, Windows 7, Windows Vista, Windows XP

Community Additions

ADD
Show: