3#include "structure/design_pattern/spk_activable_object.hpp"
4#include "structure/design_pattern/spk_synchronizable_object.hpp"
5#include "structure/math/spk_matrix.hpp"
6#include "structure/math/spk_vector2.hpp"
7#include "structure/math/spk_vector3.hpp"
8#include "structure/math/spk_vector4.hpp"
9#include "structure/opengl/spk_opengl_includes.hpp"
93 template <
typename TType>
104 using ValueStorage = std::variant<
123 int32_t _uniformLocation = -1;
124 ValueStorage _value = std::monostate{};
126 void _applyValue(
const std::monostate &);
127 void _applyValue(
const float_t &p_value);
128 void _applyValue(
const int32_t &p_value);
129 void _applyValue(
const uint32_t &p_value);
130 void _applyValue(
const bool &p_value);
131 void _applyValue(
const spk::Vector2 &p_value);
132 void _applyValue(
const spk::Vector2Int &p_value);
133 void _applyValue(
const spk::Vector2UInt &p_value);
134 void _applyValue(
const spk::Vector3 &p_value);
135 void _applyValue(
const spk::Vector3Int &p_value);
136 void _applyValue(
const spk::Vector3UInt &p_value);
137 void _applyValue(
const spk::Vector4 &p_value);
138 void _applyValue(
const spk::Vector4Int &p_value);
139 void _applyValue(
const spk::Vector4UInt &p_value);
140 void _applyValue(
const spk::Matrix2x2 &p_value);
141 void _applyValue(
const spk::Matrix3x3 &p_value);
142 void _applyValue(
const spk::Matrix4x4 &p_value);
144 void _onSynchronize()
override;
145 void _registerCallbacks();
165 template <
typename TType>
173 using Decayed = std::decay_t<TType>;
174 static_assert(detail::IsSupportedUniformType<Decayed>,
"Unsupported uniform type for UniformObject");
176 _value = std::forward<TType>(p_value);
180 template <
typename TType>
188 return (std::get<TType>(_value));
Stateful helper toggling between activated/deactivated states.
Definition spk_activable_object.hpp:20
Base for objects requiring deferred synchronization hooks.
Definition spk_synchronizable_object.hpp:10
void requestSynchronization() noexcept
Marks the object as needing synchronization.
Definition spk_synchronizable_object.hpp:23