CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::VertexLayoutElement Struct Reference

Represents the memory position of a single vertex element. More...

#include <CeresEngine/Mesh/VertexLayout.hpp>

Public Member Functions

size_t operator[] (const size_t index) const
 Computes the absolute offset of the vertex at position index.
 
template<typename T >
StridedMemoryView< const Tview (const MemoryView< const Byte > view, const size_t count=0) const
 Returns a StridedMemoryView that allows iterating over every vertex of of this element in a vertex buffer.
 
template<typename T >
StridedMemoryView< Tview (const MemoryView< Byte > view, const size_t count=0) const
 Returns a StridedMemoryView that allows iterating over every vertex of of this element in a vertex buffer.
 

Public Attributes

VertexElement element
 The vertex element description.
 
size_t offset = 0
 The offset to where this vertex element starts.
 
size_t stride = 0
 The stride, the amount of bytes to skip to reach the next vertex data.
 

Detailed Description

Represents the memory position of a single vertex element.

Member Function Documentation

◆ operator[]()

size_t CeresEngine::VertexLayoutElement::operator[] ( const size_t  index) const
inline

Computes the absolute offset of the vertex at position index.

Parameters
indexThe index whose vertex address should be calculated.
Returns
The address, in bytes, to where the vertex at index can be found, relative from the start of the vertex buffer.

◆ view() [1/2]

template<typename T >
StridedMemoryView< T > CeresEngine::VertexLayoutElement::view ( const MemoryView< Byte view,
const size_t  count = 0 
) const
inline

Returns a StridedMemoryView that allows iterating over every vertex of of this element in a vertex buffer.

Template Parameters
TThe vertex element type.
Parameters
viewA MemoryView of the vertex buffer.
countThe number of vertices in the view buffer.
Returns
A StridedMemoryView that iterates over every vertex in the buffer.

◆ view() [2/2]

template<typename T >
StridedMemoryView< const T > CeresEngine::VertexLayoutElement::view ( const MemoryView< const Byte view,
const size_t  count = 0 
) const
inline

Returns a StridedMemoryView that allows iterating over every vertex of of this element in a vertex buffer.

Template Parameters
TThe vertex element type.
Parameters
viewA MemoryView of the vertex buffer.
countThe number of vertices in the view buffer.
Returns
A StridedMemoryView that iterates over every vertex in the buffer.

Member Data Documentation

◆ element

VertexElement CeresEngine::VertexLayoutElement::element

The vertex element description.

Describes type, size and semantic of a vertex element.

◆ offset

size_t CeresEngine::VertexLayoutElement::offset = 0

The offset to where this vertex element starts.

◆ stride

size_t CeresEngine::VertexLayoutElement::stride = 0

The stride, the amount of bytes to skip to reach the next vertex data.


The documentation for this struct was generated from the following file: