Go to the documentation of this file.
9 #ifndef EAGINE_SHAPES_DELEGATED_HPP
10 #define EAGINE_SHAPES_DELEGATED_HPP
24 : _gen{std::move(gen)} {}
27 return _gen->attrib_bits();
31 return _gen->enable(cap, value);
35 return _gen->is_enabled(cap);
39 return _gen->vertex_count();
43 return _gen->attribute_variants(attrib);
47 return _gen->variant_name(vav);
51 return _gen->values_per_vertex(vav);
55 return _gen->attrib_type(vav);
59 return _gen->is_attrib_normalized(vav);
63 _gen->attrib_values(vav, dest);
68 _gen->attrib_values(vav, dest);
73 _gen->attrib_values(vav, dest);
78 _gen->attrib_values(vav, dest);
83 _gen->attrib_values(vav, dest);
87 _gen->attrib_values(vav, dest);
91 return _gen->draw_variant_count();
95 return _gen->index_type(var);
99 return _gen->index_count(var);
103 _gen->indices(var, dest);
107 _gen->indices(var, dest);
111 _gen->indices(var, dest);
115 return _gen->operation_count(var);
119 _gen->instructions(var, ops);
123 return _gen->bounding_sphere();
127 auto base_generator() const noexcept -> std::shared_ptr<
generator> {
132 std::shared_ptr<generator> _gen;
138 #endif // EAGINE_SHAPES_DELEGATED_HPP
std::ptrdiff_t span_size_t
Signed span size type used by eagine.
Definition: types.hpp:36
auto enable(generator_capability cap, bool value) noexcept -> bool final
Enables or disables the specified generator capability.
Definition: delegated.hpp:30
auto values_per_vertex(vertex_attrib_variant vav) -> span_size_t override
Returns the number of values per vertex for the specified variant.
Definition: delegated.hpp:50
auto index_count(drawing_variant var) -> span_size_t override
Returns the index count for the specified drawing variant.
Definition: delegated.hpp:98
Basic template for spheres in N-dimensional space.
Definition: primitives.hpp:122
Common code is placed in this namespace.
Definition: eagine.hpp:21
void attrib_values(vertex_attrib_variant vav, span< std::int16_t > dest) override
Fetches the vertex attribute data for the specified variant as integers.
Definition: delegated.hpp:67
void attrib_values(vertex_attrib_variant vav, span< std::uint32_t > dest) override
Fetches the vertex attribute data for the specified variant as integers.
Definition: delegated.hpp:81
Interface for shape loaders or generators.
Definition: gen_base.hpp:35
auto vertex_count() -> span_size_t override
Returns the shaped vertex count.
Definition: delegated.hpp:38
void attrib_values(vertex_attrib_variant vav, span< float > dest) override
Fetches the vertex attribute data for the specified variant as floats.
Definition: delegated.hpp:86
auto attrib_type(vertex_attrib_variant vav) -> attrib_data_type override
Returns the attribute data type for the specified variant.
Definition: delegated.hpp:54
auto operation_count(drawing_variant var) -> span_size_t override
Returns the number of drawing instructions for the specified variant.
Definition: delegated.hpp:114
void attrib_values(vertex_attrib_variant vav, span< std::int32_t > dest) override
Fetches the vertex attribute data for the specified variant as integers.
Definition: delegated.hpp:72
Class designating an vertex attribute variant in a shape generator.
Definition: vertex_attrib.hpp:104
auto index_type(drawing_variant var) -> index_data_type override
Returns the index data type for the specified draw variant.
Definition: delegated.hpp:94
auto draw_variant_count() -> span_size_t override
Returns the count of possible shape draw variants.
Definition: delegated.hpp:90
void attrib_values(vertex_attrib_variant vav, span< byte > dest) override
Fetches the vertex attribute data for the specified variant as bytes.
Definition: delegated.hpp:62
auto attribute_variants(vertex_attrib_kind attrib) -> span_size_t override
Returns the count of shape attribute variants.
Definition: delegated.hpp:42
void attrib_values(vertex_attrib_variant vav, span< std::uint16_t > dest) override
Fetches the vertex attribute data for the specified variant as integers.
Definition: delegated.hpp:76
generator_capability
Shape generator capability bit enumeration.
Definition: gen_capabilities.hpp:21
span_size_t drawing_variant
Alias for shape drawing variant index type.
Definition: gen_base.hpp:31
void indices(drawing_variant var, span< std::uint32_t > dest) override
Fetches the index data for the specified drawing variant.
Definition: delegated.hpp:110
auto attrib_bits() noexcept -> vertex_attrib_bits final
Returns the set of vertex attributes supported by this generator.
Definition: delegated.hpp:26
auto is_attrib_normalized(vertex_attrib_variant vav) -> bool override
Indicates if the specified variant attribute values should be normalized.
Definition: delegated.hpp:58
vertex_attrib_kind
Shape vertex attribute kind enumeration.
Definition: vertex_attrib.hpp:25
auto is_enabled(generator_capability cap) noexcept -> bool final
Indicates if the specified generator capability is enabled.
Definition: delegated.hpp:34
attrib_data_type
Shape vertex attribute data type enumeration.
Definition: drawing.hpp:67
void indices(drawing_variant var, span< std::uint8_t > dest) override
Fetches the index data for the specified drawing variant.
Definition: delegated.hpp:102
Base class for delegating shape generators based on other generators.
Definition: delegated.hpp:21
index_data_type
Shape element index type enumeration.
Definition: drawing.hpp:111
auto variant_name(vertex_attrib_variant vav) -> string_view override
Returns the name of the specified attribute variant.
Definition: delegated.hpp:46
void instructions(drawing_variant var, span< draw_operation > ops) override
Fetches the drawing operations for the specified drawing variant.
Definition: delegated.hpp:118
auto bounding_sphere() -> math::sphere< float, true > override
Returns the bounding sphere for the generated shape.
Definition: delegated.hpp:122
void indices(drawing_variant var, span< std::uint16_t > dest) override
Fetches the index data for the specified drawing variant.
Definition: delegated.hpp:106