Sdílet prostřednictvím


IndexBuffer.GetData Generic Method (Int32, T , Int32, Int32)

Gets a copy of the index buffer data, specifying the start index, starting offset, number of elements, and size of the elements.

Syntax

'Declaration
Public Sub GetData(Of T As ValueType) ( _
         offsetInBytes As Integer, _
         data As T(), _
         startIndex As Integer, _
         elementCount As Integer _
)
public void GetData<T> (
         int offsetInBytes,
         T[] data,
         int startIndex,
         int elementCount
) where T : ValueType
public:
generic<typename T> where T : ValueType
void GetData(
         int offsetInBytes,
         T data[],
         int startIndex,
         int elementCount
)

Type Parameters

  • T
    The type of elements in the array.

Parameters

  • offsetInBytes
    Type: Int32
    Offset in bytes from the beginning of the buffer to the data.
  • data
    Type: T
    Array of data.
  • startIndex
    Type: Int32
    Index of the first element to get.
  • elementCount
    Type: Int32
    Number of elements to get.

Exceptions

Exception type Condition
ArgumentNullException data is null.
InvalidOperationException The array specified in the data parameter is not the correct size for the amount of data requested.
NotSupportedException This IndexBuffer was created with a usage type of BufferUsage.WriteOnly. Calling GetData on a resource that was created with BufferUsage.WriteOnly is not supported.

Requirements

Namespace: Microsoft.Xna.Framework.Graphics

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

See Also

Reference

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

Platforms

Windows Phone