OGLplus  (0.59.0) a C++ wrapper for rendering APIs

occluded.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_SHAPES_OCCLUDED_HPP
10 #define EAGINE_SHAPES_OCCLUDED_HPP
11 
12 #include "delegated.hpp"
13 #include <eagine/config/basic.hpp>
14 #include <utility>
15 
16 namespace eagine {
17 namespace shapes {
18 //------------------------------------------------------------------------------
22 class occluded_gen : public delegated_gen {
23 
24 public:
25  occluded_gen(std::shared_ptr<generator> gen, span_size_t samples) noexcept
26  : delegated_gen{std::move(gen)}
27  , _samples{samples} {}
28 
29  void attrib_values(vertex_attrib_variant, span<float>) override;
30 
31 private:
32  span_size_t _samples{64};
33 };
34 //------------------------------------------------------------------------------
37 static inline auto
38 occlude(std::shared_ptr<generator> gen, span_size_t samples = 8) noexcept {
39  return std::make_unique<occluded_gen>(std::move(gen), samples);
40 }
41 //------------------------------------------------------------------------------
42 
43 } // namespace shapes
44 } // namespace eagine
45 
46 #if !EAGINE_LINK_LIBRARY || defined(EAGINE_IMPLEMENTING_LIBRARY)
47 #include <eagine/shapes/occluded.inl>
48 #endif
49 
50 #endif // EAGINE_SHAPES_OCCLUDED_HPP
std::ptrdiff_t span_size_t
Signed span size type used by eagine.
Definition: types.hpp:36
Common code is placed in this namespace.
Definition: eagine.hpp:21
void attrib_values(vertex_attrib_variant, span< float >) override
Fetches the vertex attribute data for the specified variant as floats.
Class designating an vertex attribute variant in a shape generator.
Definition: vertex_attrib.hpp:104
Generator modifier calculating vertex occlusion weights.
Definition: occluded.hpp:22
static auto occlude(std::shared_ptr< generator > gen, span_size_t samples=8) noexcept
Constructs instances of occluded_gen modifier.
Definition: occluded.hpp:38
Base class for delegating shape generators based on other generators.
Definition: delegated.hpp:21

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).