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​Vertex​Prepare


[BeginEnd]
public method WriteVertexPrepare → (2)

from in : int32

Index of first vertex to write, inclusive.

to in : int32

Index of last vertex to write, exclusive.

Prepares the current vertex buffer for writing to the given range of vertices.

Write​Vertices


[BeginEnd]
public method WriteVertices → (3)

first in : int32

[>=0]
First vertex to write.

count in : int32

[>=0]
Number of vertices to write.

indices opt : int32 [ ] = null

Vertex indices or null

Writes vertex data to the current vertex buffer.

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

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

This method calls WriteVertexPrepare, where necessary.