Go to the documentation of this file. 1 #ifndef OGLPLUS_TEXGEN_CONST_OUTPUT_HPP
9 #define OGLPLUS_TEXGEN_CONST_OUTPUT_HPP
15 #include <type_traits>
17 namespace eagine::oglp::texgen {
20 class constant_output;
22 class constant_output_base :
public base_output {
24 constant_output_base(node_intf& parent) noexcept
25 : base_output(parent) {}
31 render_param_bits required_params()
override {
32 return render_param_bits();
36 template <
typename T, span_
size_t N>
37 class constant_output<T[N]> :
public constant_output_base {
39 std::array<T, N> _coords;
42 constant_output(node_intf& parent) noexcept
43 : constant_output_base(parent)
46 template <
typename... P,
typename = std::enable_if_t<
sizeof...(P) == N>>
47 constant_output(node_intf& parent, P... coords) noexcept
48 : constant_output_base(parent)
49 , _coords{{T(coords)...}} {}
51 template <
typename... P,
typename = std::enable_if_t<
sizeof...(P) == N>>
52 void set(P... coords) noexcept {
53 _coords = std::array<T, N>{{T(coords)...}};
56 bool set_default_value(
span_size_t c,
float v)
override {
64 slot_data_type
value_type() noexcept
override {
65 return get_data_type_v<T[N]>;
68 std::ostream& expression(std::ostream& out, compile_context&)
override {
81 #endif // OGLPLUS_TEXGEN_CONST_OUTPUT_HPP
value_type
Value tree value element data type enumeration.
Definition: interface.hpp:27
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
static constexpr auto std_size(T v) noexcept
Converts argument to std size type.
Definition: types.hpp:52
integer_range(B, E) -> integer_range< std::common_type_t< B, E >>
Deduction guide for integer_range.