3 #ifndef GDK_GFX_VERTEX_DATA_VIEW_H 4 #define GDK_GFX_VERTEX_DATA_VIEW_H 9 #include <unordered_map> 22 const size_t aDataLength,
23 const size_t aComponentCount);
27 size_t data_size()
const;
29 size_t component_count()
const;
40 size_t m_ComponentCount;
47 using index_value_type =
unsigned short;
49 enum class PrimitiveMode
54 using attribute_data_type =
55 std::unordered_map<std::string, attribute_data_view>;
61 value_type *
const begin;
63 const std::size_t size;
66 PrimitiveMode getPrimitiveMode()
const;
68 const std::vector<attribute_data_view::attribute_component_type> &getData()
const;
70 const std::vector<std::pair<std::string, std::size_t>> &attribute_format()
const;
72 size_t attribute_offset(
const std::string &aName)
const;
74 size_t vertex_size()
const;
76 size_t interleaved_data_size()
const;
79 std::vector<index_value_type> getIndexData()
const;
91 vertex_data(
const attribute_data_type &aAttributeData);
101 PrimitiveMode m_PrimitiveMode = PrimitiveMode::Triangles;
104 std::vector<attribute_data_view::attribute_component_type> m_Data;
107 std::vector<std::pair<std::string, size_t>> m_Format;
110 std::unordered_map<std::string, size_t> m_AttributeOffsets;
used to construct a model. Vertex data represents a set of vertex data in system memory ...
Definition: vertex_data.h:44
Definition: vertex_data.h:57
a view on to the data for a given attribute e.g: "uv", "position". a view does not own its data...
Definition: vertex_data.h:15
float attribute_component_type
all vertex components must be of this type.
Definition: vertex_data.h:19