gdk-graphics 0a0aef92e917cfbac53dffbc32c295e4de914093
Loading...
Searching...
No Matches
attribute_data.h
1// © Joseph Cameron - MIT License
2
3#ifndef GDK_GRAPHICS_ATTRIBUTE_DATA_H
4#define GDK_GRAPHICS_ATTRIBUTE_DATA_H
5
6#include <cstddef>
7#include <gdk/graphics/data_types.h>
8
9#include <vector>
10#include <initializer_list>
11#include <span>
12
13namespace gdk::graphics {
15 using component_type = floating_point_type;
16
18 class attribute_data final {
19 public:
23
24 std::size_t number_of_attributes_in_component_data() const;
25
27 const std::vector<component_type> &components() const;
28
30 std::vector<component_type> &components();
31
32 void push_back(const attribute_data &rhs);
33
34 attribute_data &operator+=(const attribute_data &rhs);
35
36 void overwrite(std::size_t vertexOffset, const attribute_data &other);
37
42
46 attribute_data(const attribute_data &) = default;
47
48 attribute_data(std::span<const component_type> aComponents, const std::size_t aComponentCount);
49
50 attribute_data(std::initializer_list<component_type> aComponents, const std::size_t aComponentCount);
51 attribute_data() = default;
52 ~attribute_data() = default;
53
54 private:
55 std::size_t m_NumberOfComponentsPerAttribute{};
56 std::vector<component_type> m_Components{};
57 };
58}
59
60#endif
61
attribute_data & operator=(attribute_data &&a)=default
support move semantics
attribute_data & operator=(const attribute_data &a)=default
support copy semantics
attribute_data(const attribute_data &)=default
support copy semantics
std::size_t number_of_components_per_attribute() const
attribute_data(attribute_data &&)=default
support move semantics
const std::vector< component_type > & components() const
const access to the list of components in this attribute
std::vector< component_type > & components()
nonconst access to the list of components in this attribute