IVertexFormat

Description

interface Tinman.Terrain.Vertices.Formats.IVertexFormat

Derived from

IVertexArraysDependent
IVertexLayout

Extended by

VertexFormatBase abstract

Base interface for classes that convert vertex data stored in a one or more IVertexArray containers to GPU vertex data.

A IVertexFormat always uses the byte endianness of the system when writing multi-byte values (e.g. float32, int32).

Public / Methods

Begin


public method Begin → (2)

buffer in : ByteBuffer

[not-null]
The vertex buffer. The current buffer position must point to the vertex with index 0.

mapped opt : IGpuBuffer = null

Optional GPU buffer to use for preparing buffer in via IGpuBuffer.BufferPrepare before writing vertex data.

Begins to write vertex data to the given vertex buffer.

End


public method End → ()

Ends writing of vertex data.

Write​Vertices

2 overloads


[BeginEnd]
public method WriteVertices1 → (3)

first in : int32

[>=0]
First vertex to write.

count in : int32

[>=0]
Number of vertices to write.

granularity opt : int32 = 0

The granularity of vertex updates, which is passed to the maximum parameter of IGpuBuffer.BufferMap. If no GPU buffer has been passed to Begin, the granularity is ignored.

Writes vertex data to the current vertex buffer.

A vertex is written for each value in the number sequence [first..first+count[.


[BeginEnd]
public method WriteVertices2 → (4)

first in : int32

[>=0]
First vertex to write.

count in : int32

[>=0]
Number of vertices to write.

indices in : int32 [ ]

Vertex indices or null

granularity opt : int32 = 0

The granularity of vertex updates, which is passed to the maximum parameter of IGpuBuffer.BufferMap. If no GPU buffer has been passed to Begin, the granularity is ignored.

Writes vertex data to the current vertex buffer.

If indices in is null, a vertex is written for each value in the number sequence [first..first+count[.

If indices in is not null, a vertex is written for each value that has been read from indices in, using the number sequence [first..first+count[ as array element indices.