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

Contains the definition of a single vertex buffer layout. More...

#include <CeresEngine/Mesh/VertexLayout.hpp>

Public Member Functions

void addElement (VertexElement element, const size_t offset, size_t stride=~0ul)
 Adds a new element to the vertex layout.
 

Static Public Member Functions

static VertexLayout interleaved (const VertexDeclaration &declaration)
 Computes a layout in which every vertex element in declaration is interleaved, that is, for every vertex all it's elements are packed one after the other.
 
static VertexLayout separated (const VertexDeclaration &declaration, const std::size_t vertexCount)
 Computes a layout in which every vertex element in declaration is separated, that is, first all values of the first element are placed, then all values of the second element and so on until the end of all elements.
 

Public Attributes

Vector< VertexLayoutElementlayoutElements
 

Detailed Description

Contains the definition of a single vertex buffer layout.

Member Function Documentation

◆ addElement()

void CeresEngine::VertexLayout::addElement ( VertexElement  element,
const size_t  offset,
size_t  stride = ~0ul 
)
inline

Adds a new element to the vertex layout.

Parameters
elementThe vertex element that describes the format and semantic of the element.
offsetThe offset, from the begging of the buffer, where data from this element starts.
strideThe stride to the next vertex of the same element.

◆ interleaved()

static VertexLayout CeresEngine::VertexLayout::interleaved ( const VertexDeclaration declaration)
inlinestatic

Computes a layout in which every vertex element in declaration is interleaved, that is, for every vertex all it's elements are packed one after the other.

Parameters
declarationThe vertex declaration to create the layout from.
Returns
The computed layout.

◆ separated()

static VertexLayout CeresEngine::VertexLayout::separated ( const VertexDeclaration declaration,
const std::size_t  vertexCount 
)
inlinestatic

Computes a layout in which every vertex element in declaration is separated, that is, first all values of the first element are placed, then all values of the second element and so on until the end of all elements.

Parameters
declarationThe vertex declaration to create the layout from.
vertexCountThe number of vertices present in the buffer.
Returns
The computed layout.

Member Data Documentation

◆ layoutElements

Vector<VertexLayoutElement> CeresEngine::VertexLayout::layoutElements

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