16 template <IsVertexType V>
18 std::span<const IndexType> indices = {});
20 template <IsVertexType V,
size_t N,
size_t M>
25 std::span<const char> vertices,
26 std::span<const IndexType> indices = {});
31template <IsVertexType V>
33 std::span<const V> vertices,
34 std::span<const IndexType> indices)
37 ,
vertexData(reinterpret_cast<const char *>(vertices.data()),
38 vertices.size() * sizeof(V))
41template <IsVertexType V,
size_t N,
size_t M>
43 const V (&vertices)[N],
46 std::span<const IndexType>{indices}) {}
A class to store type-erased vertex data and index data.
Definition MeshData.h:33
Uint32 IndexType
Definition MeshData.h:40
This class defines the layout of a mesh's vertices.
Definition MeshLayout.h:98
MeshLayout meshLayoutFor()
Shortcut for extracting layout from compile-time struct.
Definition MeshLayout.h:211
MeshDataView(SDL_GPUPrimitiveType primitiveType, const MeshLayout &layout, std::span< const char > vertices, std::span< const IndexType > indices={})
std::span< const IndexType > indexData
Definition MeshDataView.h:12
std::span< const char > vertexData
Definition MeshDataView.h:11
MeshDataView(const MeshData &meshData)
MeshData::IndexType IndexType
Definition MeshDataView.h:8
MeshLayout layout
Definition MeshDataView.h:10
SDL_GPUPrimitiveType primitiveType
Definition MeshDataView.h:9