DynamicVertexBuffer.SetData Generic Method (Int32, T , Int32, Int32, Int32, SetDataOptions)

Copies array data to the vertex buffer.

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

Syntax

public void SetData<T> (
         int offsetInBytes,
         T[] data,
         int startIndex,
         int elementCount,
         int vertexStride,
         SetDataOptions options
) where T : ValueType

Type Parameters

  • T
    The type of the elements in the array.

Parameters

  • offsetInBytes
    Number of bytes into the index buffer where copying will start.
  • data
    The array of data to copy.
  • startIndex
    The index of the element in the array at which to start copying.
  • elementCount
    The number of elements to copy.
  • vertexStride
    The size, in bytes, of the elements in the vertex buffer.
  • options
    Specifies whether existing data in the buffer will be kept after this operation. Discard is not valid on Xbox 360, but dynamic geometry may be rendered on the Xbox 360 by using DrawUserIndexedPrimitives instead of setting the data for the vertex buffer.

Remarks

An InvalidOperationException is thrown if an attempt is made to modify (for example, calls to the SetData method) a resource that is currently set on a graphics device.

See Also

Reference

DynamicVertexBuffer Class
DynamicVertexBuffer Members
Microsoft.Xna.Framework.Graphics Namespace

Platforms

Xbox 360, Windows XP SP2, Windows Vista