|
CeresEngine 0.2.0
A game development framework
|
Determines how vertices are laid-out on a vertex buffer or a mesh data. More...
#include <CeresEngine/Mesh/VertexDeclaration.hpp>
Public Member Functions | |
| const VertexElement * | getElement (const VertexElementSemantic &semantic, UInt32 index=0) const noexcept |
Finds a VertexElement with the given semantic. | |
| VertexElement * | getElement (const VertexElementSemantic &semantic, UInt32 index=0) noexcept |
Finds a VertexElement with the given semantic. | |
| VertexElement & | addElement (const VertexElementSemantic &semantic, const VertexElementType &type, const VertexElementComponentType &componentType=VertexElementComponentType::Float32, bool normalized=false) |
| Adds a new element to the declaration. | |
| template<typename T > | |
| VertexElement & | addElement (const VertexElementSemantic &semantic, bool normalized=false) |
Adds a new element to the declaration by automatically deducing the VertexElementType and VertexElementComponentType based on the C++ type T. | |
| bool | removeElement (const VertexElementSemantic &semantic, UInt32 index=0) noexcept |
| Removes a vertex element from the declaration. | |
| std::size_t | getSize () const noexcept |
| Computes the size of a single vertex, in bytes. | |
| std::size_t | getElementOffset (const VertexElementSemantic &semantic, UInt32 index=0) const noexcept |
| Computes the offset of the given element, in bytes. | |
| String | toString () const noexcept |
Gets a string representation of the VertexDeclaration. | |
| void | toString (std::ostream &stream) const noexcept |
Writes a string representation of the VertexDeclaration to the given stream. | |
Public Attributes | |
| SmallVector< VertexElement, 10 > | elements |
Friends | |
| std::ostream & | operator<< (std::ostream &stream, const VertexDeclaration &object) |
| bool | operator== (const VertexDeclaration &lhs, const VertexDeclaration &rhs) noexcept |
| bool | operator!= (const VertexDeclaration &lhs, const VertexDeclaration &rhs) noexcept |
Determines how vertices are laid-out on a vertex buffer or a mesh data.
| VertexElement & CeresEngine::VertexDeclaration::addElement | ( | const VertexElementSemantic & | semantic, |
| bool | normalized = false |
||
| ) |
Adds a new element to the declaration by automatically deducing the VertexElementType and VertexElementComponentType based on the C++ type T.
| T | The type to be used for deducing the type and component type from. |
| semantic | The semantic to create the new element with. |
| normalized | If true, the element will have it's values normalized. |
| VertexElement & CeresEngine::VertexDeclaration::addElement | ( | const VertexElementSemantic & | semantic, |
| const VertexElementType & | type, | ||
| const VertexElementComponentType & | componentType = VertexElementComponentType::Float32, |
||
| bool | normalized = false |
||
| ) |
Adds a new element to the declaration.
| semantic | The semantic to create the new element with. |
| type | The type of element to be created. |
| componentType | The element component data type. |
| normalized | If true, the element will have it's values normalized. |
|
noexcept |
Finds a VertexElement with the given semantic.
If multiple elements with the same semantics exists, they can be queried using index.
| 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. |
VertexElement or nullptr if no such vertex element exists.
|
noexcept |
Finds a VertexElement with the given semantic.
If multiple elements with the same semantics exists, they can be queried using index.
| 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. |
VertexElement or nullptr if no such vertex element exists.
|
noexcept |
Computes the offset of the given element, in bytes.
The offset is given relative to the beginning of the vertex memory.
|
noexcept |
Computes the size of a single vertex, in bytes.
|
noexcept |
Removes a vertex element from the declaration.
| semantic | The semantic of the vertex element to be removed. |
| index | An optional index. If multiple elements with the same semantic exists, this allows querying the index-th element with the given semantic. |
|
noexcept |
Gets a string representation of the VertexDeclaration.
|
noexcept |
Writes a string representation of the VertexDeclaration to the given stream.
|
friend |
|
friend |
|
friend |
| SmallVector<VertexElement, 10> CeresEngine::VertexDeclaration::elements |