Share via


DynamicVertexBuffer.SetData<T> Method (Int32, array<T[], Int32, Int32, Int32, SetDataOptions)

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

Sets dynamic vertex buffer data, specifying the offset, start index, number of elements and vertex stride.

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

Syntax

'Declaration
Public Sub SetData(Of T As {Structure, New}) ( _
    offsetInBytes As Integer, _
    data As T(), _
    startIndex As Integer, _
    elementCount As Integer, _
    vertexStride As Integer, _
    options As SetDataOptions _
)
public void SetData<T>(
    int offsetInBytes,
    T[] data,
    int startIndex,
    int elementCount,
    int vertexStride,
    SetDataOptions options
)
where T : struct, new()

Type Parameters

  • T
    The type of the elements in the array.

Parameters

  • offsetInBytes
    Type: System.Int32
    Offset in bytes from the beginning of the buffer to the data.
  • data
    Type: array<T[]
    Array of data.
  • elementCount
    Type: System.Int32
    The number of elements to use.
  • vertexStride
    Type: System.Int32
    The size, in bytes, of the elements in 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.

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.