CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::VertexElementType Struct Referencefinal

Enumeration that determines the type of a VertexElement. More...

#include <CeresEngine/Mesh/VertexDeclaration.hpp>

Inheritance diagram for CeresEngine::VertexElementType:
CeresEngine::StructEnum< VertexElementType >

Public Types

enum  : UnderlyingType {
  None , Scalar , Vector2 , Vector3 ,
  Vector4 , Matrix2 , Matrix3 , Matrix4
}
 The underlying raw value of VertexElementType. More...
 
using RawType = decltype(raw)
 
- Public Types inherited from CeresEngine::StructEnum< VertexElementType >
using UnderlyingType = UInt32
 
using Self = VertexElementType
 

Public Member Functions

constexpr VertexElementType ()=default
 
constexpr VertexElementType (RawType raw)
 
constexpr VertexElementType (UnderlyingType raw)
 
StringView toString () const noexcept
 Gets a string representation of VertexElementType.
 
std::size_t getComponentCount () const noexcept
 Gets the number of components on the type.
 
bool isNone () const noexcept
 Returns true if the element type is a vector type.
 
bool isScalar () const noexcept
 Returns true if the element type is a vector type.
 
bool isVector () const noexcept
 Returns true if the element type is a vector type.
 
bool isMatrix () const noexcept
 Returns true if the element type is a matrix type.
 
- Public Member Functions inherited from CeresEngine::StructEnum< VertexElementType >
 operator UnderlyingType () const noexcept
 Converts the enum into it's underlying type.
 
void toString (std::ostream &stream) const noexcept
 Writes a string representation of the ShaderType to the given stream.
 

Static Public Member Functions

static Optional< VertexElementTypefromString (StringView string) noexcept
 Creates a new VertexElementType from a string representation.
 
template<typename T >
static constexpr VertexElementType fromType () noexcept
 Creates a new VertexElementType from the C++ type T.
 
- Static Public Member Functions inherited from CeresEngine::StructEnum< VertexElementType >
static Self fromRawUnderlying (UnderlyingType underlying) noexcept
 Creates a new Self from it's underlying numeric representation.
 

Public Attributes

enum CeresEngine::VertexElementType:: { ... }  raw
 The underlying raw value of VertexElementType.
 

Detailed Description

Enumeration that determines the type of a VertexElement.

Member Typedef Documentation

◆ RawType

Member Enumeration Documentation

◆ anonymous enum

The underlying raw value of VertexElementType.

Enumerator
None 

The vertex element has no type and thus no size.

Can be used for skipping non-present vertex elements.

Scalar 

The vertex element is a scalar.

Vector2 

The vertex element is a 2-component vector.

Vector3 

The vertex element is a 3-component vector.

Vector4 

The vertex element is a 4-component vector.

Matrix2 

The vertex element is a 2x2 matrix.

Matrix3 

The vertex element is a 3x3 matrix.

Matrix4 

The vertex element is a 4x4 matrix.

Constructor & Destructor Documentation

◆ VertexElementType() [1/3]

constexpr CeresEngine::VertexElementType::VertexElementType ( )
constexprdefault

◆ VertexElementType() [2/3]

constexpr CeresEngine::VertexElementType::VertexElementType ( RawType  raw)
inlineconstexpr

◆ VertexElementType() [3/3]

constexpr CeresEngine::VertexElementType::VertexElementType ( UnderlyingType  raw)
inlineexplicitconstexpr

Member Function Documentation

◆ fromString()

static Optional< VertexElementType > CeresEngine::VertexElementType::fromString ( StringView  string)
staticnoexcept

Creates a new VertexElementType from a string representation.

If the string value is invalid, an empty optional is returned.

◆ fromType()

template<typename T >
constexpr VertexElementType CeresEngine::VertexElementType::fromType ( )
staticconstexprnoexcept

Creates a new VertexElementType from the C++ type T.

◆ getComponentCount()

std::size_t CeresEngine::VertexElementType::getComponentCount ( ) const
noexcept

Gets the number of components on the type.

◆ isMatrix()

bool CeresEngine::VertexElementType::isMatrix ( ) const
inlinenoexcept

Returns true if the element type is a matrix type.

◆ isNone()

bool CeresEngine::VertexElementType::isNone ( ) const
inlinenoexcept

Returns true if the element type is a vector type.

◆ isScalar()

bool CeresEngine::VertexElementType::isScalar ( ) const
inlinenoexcept

Returns true if the element type is a vector type.

◆ isVector()

bool CeresEngine::VertexElementType::isVector ( ) const
inlinenoexcept

Returns true if the element type is a vector type.

◆ toString()

StringView CeresEngine::VertexElementType::toString ( ) const
noexcept

Gets a string representation of VertexElementType.

Member Data Documentation

◆ []

enum { ... } CeresEngine::VertexElementType::raw

The underlying raw value of VertexElementType.


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