Partilhar via


VertexBufferContent.Write Generic Method (Int32, Int32, Generic IEnumerable)

Note

This generic method is available only when developing for Windows.

Writes additional data into the vertex buffer. Writing begins at the specified byte offset, and each value is spaced according to the specified stride value (in bytes).

Syntax

'Declaration
Public Sub Write(Of T) ( _
         offset As Integer, _
         stride As Integer, _
         data As IEnumerable(Of T) _
)
public void Write<T> (
         int offset,
         int stride,
         IEnumerable<T> data
)
public:
generic<typename T>
void Write(
         int offset,
         int stride,
         IEnumerable<T> data
)

Type Parameters

  • T
    Type being written.

Parameters

  • offset
    Type: Int32
    Offset to begin writing at.
  • stride
    Type: Int32
    Stride of the data being written (in bytes).
  • data
    Type: IEnumerable<T>
    Enumerated collection of data.

Remarks

This method automatically grows the vertex buffer if an attempt is made to write past the buffer end. Write throws NotSupportedException if the specified data type cannot be packed into a vertex buffer. For example, if data is not a valid value type.

Use this method to interleave vertex data channels into a single buffer. This can be done by passing the total vertex size as the stride and suitable smaller offsets for each channel. You can also concatenate entire vertex buffers by passing the length of the vertex as the offset, 1 as the stride, and the vertex data as the data parameter.

Requirements

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors

Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

See Also

Reference

VertexBufferContent Class
VertexBufferContent Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Platforms

Windows 7, Windows Vista, Windows XP