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

wrap_node.hpp
Go to the documentation of this file.
1 #ifndef OGLPLUS_TEXGEN_WRAP_NODE_HPP
9 #define OGLPLUS_TEXGEN_WRAP_NODE_HPP
10 
11 #include "base_node.hpp"
12 #include "coord_node.hpp"
13 #include "fallback_input.hpp"
14 #include <string>
15 
16 namespace eagine::oglp::texgen {
17 
18 enum class wrap_mode { repeat, mirror, clamp };
19 
20 class wrap_output : public base_output {
21 public:
22  wrap_mode mode;
23  fallback_input<coord_output> input;
24 
25  wrap_output(node_intf& parent);
26 
27  string_view type_name() override;
28 
29  slot_data_type value_type() override;
30 
31  std::ostream& definitions(std::ostream& out, compile_context& ctxt) override;
32 };
33 
34 class wrap_node
35  : public unary_single_output_node<
36  wrap_output,
37  decltype(wrap_output::input),
38  &wrap_output::input> {
39 public:
40  wrap_node() = default;
41 
42  wrap_node& set_mode(wrap_mode mode) {
43  _output.mode = mode;
44  return *this;
45  }
46 };
47 
48 } // namespace eagine::oglp::texgen
49 
50 #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
51 #include <oglplus/texgen/wrap_node.inl>
52 #endif
53 
54 #endif // OGLPLUS_TEXGEN_WRAP_NODE_HPP
value_type
Value tree value element data type enumeration.
Definition: interface.hpp:27
basic_string_span< const char > string_view
Alias for const string views.
Definition: string_span.hpp:116
static auto type_name(const T &) noexcept -> std::string
Returns the demangled name for type T.
Definition: type_name.hpp:24

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