Determines how a vertex buffer is laid out in memory.
More...
#include <CeresEngine/Mesh/VertexDeclaration.hpp>
Determines how a vertex buffer is laid out in memory.
Usually constructed from a VertexDeclaration using VertexBufferLayout::interleaved or VertexBufferLayout::separated helper static methods.
◆ getElement() [1/2]
Finds a VertexElement with the given semantic.
If multiple elements with the same semantics exists, they can be queried using index.
- Parameters
-
| semantic | The semantic to find a vertex element for. |
| index | An optional index. If multiple elements with the same semantic exists, this allows querying the index-th element with the given semantic. |
- Returns
- The matching
VertexElement or nullptr if no such vertex element exists.
◆ getElement() [2/2]
Finds a VertexElement with the given semantic.
If multiple elements with the same semantics exists, they can be queried using index.
- Parameters
-
| semantic | The semantic to find a vertex element for. |
| index | An optional index. If multiple elements with the same semantic exists, this allows querying the index-th element with the given semantic. |
- Returns
- The matching
VertexElement or nullptr if no such vertex element exists.
◆ getElementView() [1/2]
◆ getElementView() [2/2]
◆ getSize()
| std::size_t CeresEngine::VertexBufferLayout::getSize |
( |
| ) |
const |
|
noexcept |
Computes the size of a single vertex, in bytes.
◆ getVertexSize()
| std::size_t CeresEngine::VertexBufferLayout::getVertexSize |
( |
| ) |
const |
|
noexcept |
Computes the number of bytes in a single vertex.
◆ interleaved() [1/2]
◆ interleaved() [2/2]
◆ offsetBy()
| void CeresEngine::VertexBufferLayout::offsetBy |
( |
const Int64 |
offset | ) |
const |
Offsets the vertex buffer by the given amount.
◆ resize()
| void CeresEngine::VertexBufferLayout::resize |
( |
UInt64 |
newVertexCount | ) |
|
Resizes the vertex buffer layout to accommodate newVertexCount vertices.
The vertex data is not effectively moved, only the new offsets are computed based on the new vertex count. The user is responsible to copy and move data around such as that the new vertex buffer matches the layout.
◆ separated() [1/2]
◆ separated() [2/2]
◆ toString() [1/2]
| String CeresEngine::VertexBufferLayout::toString |
( |
| ) |
const |
|
noexcept |
◆ toString() [2/2]
| void CeresEngine::VertexBufferLayout::toString |
( |
std::ostream & |
stream | ) |
const |
|
noexcept |
◆ validate()
| void CeresEngine::VertexBufferLayout::validate |
( |
| ) |
|
◆ operator!=
◆ operator<<
◆ operator==
◆ elements
The elements on the vertex stream layout.
◆ length
| UInt64 CeresEngine::VertexBufferLayout::length |
The total number of vertices in the vertex buffer.
The documentation for this struct was generated from the following file: