VertexBuffer Class

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Represents a list of 3D vertices to be streamed to the graphics device.

Inheritance Hierarchy

System.Object
  Microsoft.Xna.Framework.Graphics.GraphicsResource
    Microsoft.Xna.Framework.Graphics.VertexBuffer
      Microsoft.Xna.Framework.Graphics.DynamicVertexBuffer

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

Syntax

'Declaration
Public Class VertexBuffer _
    Inherits GraphicsResource
public class VertexBuffer : GraphicsResource

The VertexBuffer type exposes the following members.

Constructors

  Name Description
Public method VertexBuffer(GraphicsDevice, VertexDeclaration, Int32, BufferUsage) Initializes a new instance of the VertexBuffer class.
Public method VertexBuffer(GraphicsDevice, Type, Int32, BufferUsage) Initializes a new instance of the VertexBuffer class.

Top

Properties

  Name Description
Public property BufferUsage Gets the state of the related BufferUsage enumeration.
Public property IsDisposed Gets a value that indicates whether the object is disposed. (Inherited from GraphicsResource.)
Public property VertexCount Gets the number of vertices.
Public property VertexDeclaration Defines per-vertex data in a buffer.

Top

Methods

  Name Description
Public method Dispose() Immediately releases the unmanaged resources used by this object. (Inherited from GraphicsResource.)
Protected method Dispose(Boolean) Immediately releases the unmanaged resources used by this object. (Inherited from GraphicsResource.)
Protected method Finalize Allows this object to attempt to free resources and perform other cleanup operations before garbage collection reclaims the object. (Inherited from GraphicsResource.)
Public method SetData<T>(array<T[]) Sets vertex buffer data.
Public method SetData<T>(array<T[], Int32, Int32) Sets vertex buffer data, specifying the start index and number of elements.
Public method SetData<T>(Int32, array<T[], Int32, Int32, Int32) Sets vertex buffer data, specifying the offset, start index, number of elements, and the vertex stride.

Top

Version Information

Silverlight

Supported in: 5

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.