Go to the documentation of this file. 1 #ifndef OGLPLUS_TEXGEN_BASE_NODE_HPP
9 #define OGLPLUS_TEXGEN_BASE_NODE_HPP
16 namespace eagine::oglp::texgen {
18 class base_node :
public node_intf {
23 base_node() noexcept = default;
29 bool can_add_input() override;
37 void update_needed() override;
39 void prepare() override;
41 bool render(const render_params&) override;
44 class base_single_output_node : public base_node {
46 virtual base_output& single_output() = 0;
55 template <
typename Output>
56 class single_output_node :
public base_single_output_node {
61 template <
typename... P>
62 single_output_node(P&&... p)
63 : _output(*this, std::forward<P>(p)...) {}
65 base_output& single_output()
override {
70 template <
typename Output,
typename T1, T1 Output::*Input1>
71 class unary_single_output_node :
public single_output_node<Output> {
73 using single_output_node<Output>::single_output_node;
80 EAGINE_MAYBE_UNUSED(index);
81 EAGINE_ASSERT(index < input_count());
82 return this->_output.*Input1;
92 class binary_single_output_node :
public single_output_node<Output> {
94 using single_output_node<Output>::single_output_node;
101 EAGINE_ASSERT(index < input_count());
102 return (index == 0) ?
static_cast<input_intf&
>(this->_output.*Input1)
103 :
static_cast<input_intf&
>(this->_output.*Input2);
109 #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
110 #include <oglplus/texgen/base_node.inl>
113 #endif // OGLPLUS_TEXGEN_BASE_NODE_HPP
std::ptrdiff_t span_size_t
Signed span size type used by eagine.
Definition: types.hpp:36
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