candlewick 0.1.0
A renderer
|
A class to store type-erased vertex data and index data. More...
#include <candlewick/utils/MeshData.h>
Public Types | |
using | IndexType = Uint32 |
Public Member Functions | |
MeshData (NoInitT) | |
template<IsVertexType VertexT> | |
MeshData (SDL_GPUPrimitiveType primitiveType, std::vector< VertexT > vertexData, std::vector< IndexType > indexData={}) | |
MeshData (SDL_GPUPrimitiveType primitiveType, const MeshLayout &layout, std::vector< char > vertexData, std::vector< IndexType > indexData={}) | |
MeshData (MeshData &&) noexcept=default | |
MeshData & | operator= (MeshData &&) noexcept=default |
MeshData & | operator= (const MeshData &) noexcept=delete |
Uint32 | numVertices () const noexcept |
Number of individual vertices. | |
Uint32 | vertexSize () const noexcept |
Size of each vertex, in bytes. | |
Uint64 | vertexBytes () const noexcept |
Size of the overall vertex data, in bytes. | |
template<typename U> | |
std::span< U > | viewAs () |
Obtain a typed view to the underlying vertex data. | |
template<typename U> | |
std::span< const U > | viewAs () const |
Obtain a typed view to the underlying vertex data. | |
template<typename T> | |
strided_view< T > | getAttribute (const SDL_GPUVertexAttribute &attr) |
Access an attribute. Use this when the underlying vertex data type is unknown. | |
template<typename T> | |
strided_view< const T > | getAttribute (const SDL_GPUVertexAttribute &attr) const |
template<typename T> | |
strided_view< T > | getAttribute (VertexAttrib loc) |
template<typename T> | |
strided_view< const T > | getAttribute (VertexAttrib loc) const |
std::span< const char > | vertexData () const |
![]() | |
MeshData & | derived () |
const MeshData & | derived () const |
Uint32 | numVertices () const |
Uint32 | numIndices () const |
bool | isIndexed () const |
Static Public Member Functions | |
static MeshData | copy (const MeshData &other) |
Explicit copy function, uses private copy ctor. | |
Public Attributes | |
SDL_GPUPrimitiveType | primitiveType |
MeshLayout | layout |
std::vector< IndexType > | indexData |
PbrMaterial | material |
A class to store type-erased vertex data and index data.
This is to be used as an intermediate data representation class to map to Mesh objects.
using candlewick::MeshData::IndexType = Uint32 |
|
explicit |
|
explicit |
|
explicit |
|
defaultnoexcept |
Explicit copy function, uses private copy ctor.
|
inlinenodiscard |
Access an attribute. Use this when the underlying vertex data type is unknown.
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenoexcept |
Number of individual vertices.
|
inlinenoexcept |
Size of the overall vertex data, in bytes.
|
inline |
|
inlinenoexcept |
Size of each vertex, in bytes.
|
inline |
Obtain a typed view to the underlying vertex data.
This should be used in tandem with the typed constructor.
|
inline |
Obtain a typed view to the underlying vertex data.
std::vector<IndexType> candlewick::MeshData::indexData |
MeshLayout candlewick::MeshData::layout |
PbrMaterial candlewick::MeshData::material |
SDL_GPUPrimitiveType candlewick::MeshData::primitiveType |