VertexBufferContent

class VertexBufferContent : ContentItem

Provides methods and properties for managing a design-time vertex buffer that holds packed vertex data.

readonly System.Byte[] VertexData

Gets the array containing the raw bytes of the packed vertex data. Use this method to get and set the contents of the vertex buffer.

Value:Raw data of the packed vertex data.
VertexDeclarationContent VertexDeclaration

Gets and sets the associated VertexDeclarationContent object.

Value:The associated VertexDeclarationContent object.
public int SizeOf(System.Type type)

Gets the size of the specified type, in bytes.

Parameters:
  • type (System.Type) – The type.
Returns:

The size of the specified type, in bytes.

public void Write<T>(int offset, int stride, System.Collections.Generic.IEnumerable<T> data)

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).

Type Parameters:
 
  • T – Type being written.
Parameters:
  • offset (int) – Offset to begin writing at.
  • stride (int) – Stride of the data being written, in bytes.
  • data (System.Collections.Generic.IEnumerable<T>) – Enumerated collection of data.
public void Write(int offset, int stride, System.Type dataType, System.Collections.IEnumerable data)

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).

Parameters:
  • offset (int) – Offset at which to begin writing.
  • stride (int) – Stride of the data being written, in bytes.
  • dataType (System.Type) – The type of data to be written.
  • data (System.Collections.IEnumerable) – The data to write.