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

coord_node.hpp
Go to the documentation of this file.
1 #ifndef OGLPLUS_TEXGEN_COORD_NODE_HPP
9 #define OGLPLUS_TEXGEN_COORD_NODE_HPP
10 
11 #include "base_node.hpp"
12 
13 namespace eagine::oglp::texgen {
14 
15 enum class coord_type { normalized, frag_coord };
16 
17 class coord_output : public base_output {
18 private:
19  friend class coord_node;
20 
21  coord_type _type;
22 
23  string_view _func_name() const;
24 
25 public:
26  coord_output(node_intf& parent, coord_type);
27 
28  coord_output(node_intf& parent)
29  : coord_output(parent, coord_type::normalized) {}
30 
31  string_view type_name() override;
32 
33  slot_data_type value_type() override;
34 
35  std::ostream& definitions(std::ostream& out, compile_context& ctxt) override;
36 };
37 
38 class coord_node : public single_output_node<coord_output> {
39 public:
40  coord_node& set_type(coord_type type) {
41  _output._type = type;
42  return *this;
43  }
44 };
45 
46 } // namespace eagine::oglp::texgen
47 
48 #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
49 #include <oglplus/texgen/coord_node.inl>
50 #endif
51 
52 #endif // OGLPLUS_TEXGEN_COORD_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 normalized(const vector< T, N, V > &a) noexcept
Returns normalized argument.
Definition: vector.hpp:379
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).