CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::VertexElement Class Referencefinal

Determines how a single element should be a vertex. More...

#include <CeresEngine/Mesh/VertexDeclaration.hpp>

Public Member Functions

std::size_t getSize () const noexcept
 Returns the length, in bytes, of the vertex element.
 
template<typename T >
bool is () const noexcept
 Checks if the vertex element type and component type matches the C++ type T.
 
String toString () const noexcept
 Gets a string representation of the VertexElement.
 
void toString (std::ostream &stream) const noexcept
 Writes a string representation of the VertexElement to the given stream.
 

Public Attributes

VertexElementSemantic semantic
 The semantic that is used for identifying the meaning of the element in a vertex buffer.
 
VertexElementType type = VertexElementType::Scalar
 Specifies if the attribute is a scalar, vector, or matrix.
 
VertexElementComponentType componentType = VertexElementComponentType::Float32
 The datatype of components in the element.
 
UInt32 streamIndex = 0
 The index of the mesh data stream to fetch this vertex element from.
 
bool normalized = false
 Specifies whether integer data values should be normalized (true) to [0, 1] (for unsigned types) or [-1, 1] (for signed types), or converted directly (false) when they are accessed.
 

Friends

std::ostream & operator<< (std::ostream &stream, const VertexElement &object)
 
bool operator== (const VertexElement &lhs, const VertexElement &rhs) noexcept
 
bool operator!= (const VertexElement &lhs, const VertexElement &rhs) noexcept
 

Detailed Description

Determines how a single element should be a vertex.

Member Function Documentation

◆ getSize()

std::size_t CeresEngine::VertexElement::getSize ( ) const
noexcept

Returns the length, in bytes, of the vertex element.

◆ is()

template<typename T >
bool CeresEngine::VertexElement::is ( ) const
noexcept

Checks if the vertex element type and component type matches the C++ type T.

Template Parameters
TThe C++ type to check against.
Returns
True if the vertex element is of type T.

◆ toString() [1/2]

String CeresEngine::VertexElement::toString ( ) const
noexcept

Gets a string representation of the VertexElement.

◆ toString() [2/2]

void CeresEngine::VertexElement::toString ( std::ostream &  stream) const
noexcept

Writes a string representation of the VertexElement to the given stream.

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const VertexElement lhs,
const VertexElement rhs 
)
friend

◆ operator<<

std::ostream & operator<< ( std::ostream &  stream,
const VertexElement object 
)
friend

◆ operator==

bool operator== ( const VertexElement lhs,
const VertexElement rhs 
)
friend

Member Data Documentation

◆ componentType

VertexElementComponentType CeresEngine::VertexElement::componentType = VertexElementComponentType::Float32

The datatype of components in the element.

◆ normalized

bool CeresEngine::VertexElement::normalized = false

Specifies whether integer data values should be normalized (true) to [0, 1] (for unsigned types) or [-1, 1] (for signed types), or converted directly (false) when they are accessed.

◆ semantic

VertexElementSemantic CeresEngine::VertexElement::semantic

The semantic that is used for identifying the meaning of the element in a vertex buffer.

◆ streamIndex

UInt32 CeresEngine::VertexElement::streamIndex = 0

The index of the mesh data stream to fetch this vertex element from.

◆ type

VertexElementType CeresEngine::VertexElement::type = VertexElementType::Scalar

Specifies if the attribute is a scalar, vector, or matrix.


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