Class representing the vertex buffer. More...
Public Member Functions | |
VertexBuffer (int vertexCount, params VertexFormat[] formats) | |
Creates the vertex buffer. | |
VertexBuffer (int vertexCount, int indexCount, params VertexFormat[] formats) | |
Creates a vertex buffer (with an index array) | |
VertexBuffer (int vertexCount, int indexCount, int instDivisor, params VertexFormat[] formats) | |
Creates a vertex buffer (with an index array, with an instance divisor) | |
virtual Object | ShallowClone () |
Creates a copy of the vertex buffer. | |
void | Dispose () |
Frees the unmanaged resources of the vertex buffer. | |
void | SetVertices (Array vertices) |
Sets vertex data. | |
void | SetVertices (Array vertices, int to, int from, int count) |
Sets vertex data (with range) | |
void | SetVertices (int stream, Array vertices) |
Sets vertex data (for single stream) | |
void | SetVertices (int stream, Array vertices, int to, int from, int count) |
Sets vertex data (for single stream, with range) | |
void | SetVertices (int stream, Array vertices, int offset, int stride) |
Sets vertex data (for single stream, with byte offset) | |
void | SetVertices (int stream, Array vertices, VertexFormat format, Vector4 trans, Vector4 scale) |
Sets vertex data (for single stream, with format conversion) | |
void | SetVertices (int stream, Array vertices, VertexFormat format, Vector4 trans, Vector4 scale, int offset, int stride, int to, int from, int count) |
Sets vertex data (for single stream, with format conversion, with byte offset, with range) | |
void | SetIndices (ushort[] indices) |
Sets index data. | |
void | SetIndices (ushort[] indices, int to, int from, int count) |
Sets index data (with range) | |
Protected Member Functions | |
VertexBuffer (VertexBuffer buffer) | |
Creates a copy of the vertex buffer. | |
Properties | |
VertexFormat[] | Formats [get] |
Vertex format. | |
int | VertexCount [get] |
Number of vertices. | |
int | IndexCount [get] |
Number of indices. | |
int | StreamCount [get] |
Number of streams. | |
int | InstanceDivisor [get] |
Instance divisor. |
Class representing the vertex buffer.
VertexBuffer | ( | int | vertexCount, |
params VertexFormat[] | formats | ||
) |
Creates the vertex buffer.
vertexCount | Number of vertices (no vertex array if 0) |
formats | Vertex format |
Creates a vertex buffer. Specify the datatype for each vertex stream for the vertex format.
VertexBuffer | ( | int | vertexCount, |
int | indexCount, | ||
params VertexFormat[] | formats | ||
) |
Creates a vertex buffer (with an index array)
vertexCount | Number of vertices (no vertex array if 0) |
indexCount | Number of indices (no index array if 0) |
formats | Vertex format |
Creates a vertex buffer. Index arrays can be used by specifying the number of indices. Specify the datatype for each vertex stream for the vertex format.
VertexBuffer | ( | int | vertexCount, |
int | indexCount, | ||
int | instDivisor, | ||
params VertexFormat[] | formats | ||
) |
Creates a vertex buffer (with an index array, with an instance divisor)
vertexCount | Number of vertices (no vertex array if 0) |
indexCount | Number of indices (no index array if 0) |
instDivisor | Instance divisor (0 or 1) |
formats | Vertex format |
Creates a vertex buffer. Index arrays can be used by specifying the number of indices. Specify the datatype for each vertex stream for the vertex format.
The instance divisor will be used to render the instance. For details, refer to GraphicsContext.DrawArraysInstanced().
VertexBuffer | ( | VertexBuffer | buffer | ) | [protected] |
Creates a copy of the vertex buffer.
buffer | Vertex buffer |
Creates a copy of the vertex buffer. The 2 vertex buffers will then share unmanaged resources. When Dispose() is called for all copies, the shared unmanaged resources will be freed.
void SetIndices | ( | ushort[] | indices | ) |
Sets index data.
indices | Index data |
Sets index data.
This overload sets data to all indices. When the size of the array differs from the required size, an exception is thrown. When the array size is bigger than the required size, please use a different overload.
void SetIndices | ( | ushort[] | indices, |
int | to, | ||
int | from, | ||
int | count | ||
) |
Sets index data (with range)
indices | Index data |
to | Transfer destination index number |
from | Transfer source index number |
count | Number of indices to be transferred |
Sets index data.
void SetVertices | ( | int | stream, |
Array | vertices, | ||
VertexFormat | format, | ||
Vector4 | trans, | ||
Vector4 | scale | ||
) |
Sets vertex data (for single stream, with format conversion)
stream | Stream number (0 to StreamCount-1) |
vertices | Vertex data |
format | Vertex format |
trans | Translation value |
scale | Scale value |
Sets the vertex data to a specified stream. The same format as the vertex buffer or the float vector format of the same dimensionality can be specified to the vertex format. When specifying the float vector format to the vertex format, the vertex data can be converted using the (vertex-trans)/scale formula.
void SetVertices | ( | Array | vertices, |
int | to, | ||
int | from, | ||
int | count | ||
) |
Sets vertex data (with range)
vertices | Vertex data |
to | Transfer destination vertex number |
from | Transfer source vertex number |
count | Number of vertices to be transferred |
Sets vertex data. Specify the vertex data in interleaved format.
void SetVertices | ( | int | stream, |
Array | vertices, | ||
int | to, | ||
int | from, | ||
int | count | ||
) |
Sets vertex data (for single stream, with range)
stream | Stream number (0 to StreamCount-1) |
vertices | Vertex data |
to | Transfer destination vertex number |
from | Transfer source vertex number |
count | Number of vertices to be transferred |
Sets the vertex data to a specified stream.
void SetVertices | ( | int | stream, |
Array | vertices | ||
) |
Sets vertex data (for single stream)
stream | Stream number (0 to StreamCount-1) |
vertices | Vertex data |
Sets the vertex data to a specified stream.
This overload sets data to all vertices. When the size of the array differs from the required size, an exception is thrown. When the array size is bigger than the required size, please use a different overload.
void SetVertices | ( | Array | vertices | ) |
Sets vertex data.
vertices | Vertex data |
Sets vertex data. Specify the vertex data in interleaved format.
This overload sets data to all vertices. When the size of the array differs from the required size, an exception is thrown. When the array size is bigger than the required size, please use a different overload.
void SetVertices | ( | int | stream, |
Array | vertices, | ||
int | offset, | ||
int | stride | ||
) |
Sets vertex data (for single stream, with byte offset)
stream | Stream number (0 to StreamCount-1) |
vertices | Vertex data |
offset | Byte offset of vertex data |
stride | Byte stride of vertex data |
Sets the vertex data to a specified stream.
void SetVertices | ( | int | stream, |
Array | vertices, | ||
VertexFormat | format, | ||
Vector4 | trans, | ||
Vector4 | scale, | ||
int | offset, | ||
int | stride, | ||
int | to, | ||
int | from, | ||
int | count | ||
) |
Sets vertex data (for single stream, with format conversion, with byte offset, with range)
stream | Stream number (0 to StreamCount-1) |
vertices | Vertex data |
format | Vertex format |
trans | Translation value |
scale | Scale value |
offset | Byte offset of vertex data |
stride | Byte stride of vertex data |
to | Transfer destination vertex number |
from | Transfer source vertex number |
count | Number of vertices to be transferred |
Sets the vertex data to a specified stream. The same format as the vertex buffer or the float vector format of the same dimensionality can be specified to the vertex format. When specifying the float vector format to the vertex format, the vertex data can be converted using the (vertex-trans)/scale formula.
virtual Object ShallowClone | ( | ) | [virtual] |
Creates a copy of the vertex buffer.
Creates a copy of the vertex buffer. The 2 vertex buffers will then share unmanaged resources. When Dispose() is called for all copies, the shared unmanaged resources will be freed.