VertexDeclaration Constructor

Initializes a new instance of the VertexDeclaration class.

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

Syntax

public VertexDeclaration (
         GraphicsDevice graphicsDevice,
         VertexElement[] elements
)

Parameters

  • graphicsDevice
    The GraphicsDevice associated with the vertex elements.
  • elements
    An array of vertex elements.

Exceptions

Exception type Condition
ArgumentNullException graphicsDevice or elements is null.
ArgumentOutOfRangeException elements does not contain any elements, or is too large for the graphics device.
InvalidOperationException Unable to create this VertexDeclaration resource on the graphics device.

Remarks

VertexDeclaration objects must be recreated when the device is reset.

See Also

Tasks

How to: Load Resources

Reference

GraphicsDeviceManager.DeviceReset Event
VertexDeclaration Class
VertexDeclaration Members
Microsoft.Xna.Framework.Graphics Namespace

Platforms

Xbox 360, Windows XP SP2, Windows Vista