8#include <mousetrap/gl_common.hpp>
9#if MOUSETRAP_ENABLE_OPENGL_COMPONENT
10#include <mousetrap/shape.hpp>
11#include <mousetrap/shader.hpp>
12#include <mousetrap/gl_transform.hpp>
13#include <mousetrap/blend_mode.hpp>
22 struct _RenderTaskInternal
26 detail::ShapeInternal* _shape =
nullptr;
27 detail::ShaderInternal* _shader =
nullptr;
28 GLTransform _transform;
29 BlendMode _blend_mode;
31 static inline Shader* noop_shader =
nullptr;
33 std::map<std::string, float>* _floats;
34 std::map<std::string, int>* _ints;
35 std::map<std::string, glm::uint>* _uints;
36 std::map<std::string, Vector2f>* _vec2s;
37 std::map<std::string, Vector3f>* _vec3s;
38 std::map<std::string, Vector4f>* _vec4s;
39 std::map<std::string, GLTransform>* _transforms;
41 using RenderTaskInternal = _RenderTaskInternal;
157 operator GObject*()
const override;
160 detail::RenderTaskInternal* _internal;
bundles a shape in a render task that can be invoked more conveniently during the render cycle
Definition: render_task.hpp:47
int32_t get_uniform_int(const std::string &uniform_name) const
access currently registered int
Definition: render_task.cpp:232
GLTransform get_uniform_transform(const std::string &uniform_name) const
access currently registered transform (mat4x4)
Definition: render_task.cpp:332
void set_uniform_float(const std::string &uniform_name, float value)
register a float that will be handed to a shader uniform of the given name during render
Definition: render_task.cpp:146
void set_uniform_hsva(const std::string &uniform_name, HSVA value)
register a color as HSVA that will be handed to a shader uniform of the given name during render
Definition: render_task.cpp:210
float get_uniform_float(const std::string &uniform_name) const
access currently registered float
Definition: render_task.cpp:218
void set_uniform_vec4(const std::string &uniform_name, Vector4f value)
register a Vector4f that will be handed to a shader uniform of the given name during render
Definition: render_task.cpp:186
Vector3f get_uniform_vec3(const std::string &uniform_name) const
access currently registered vec3
Definition: render_task.cpp:274
HSVA get_uniform_hsva(const std::string &uniform_name) const
access currently registered color (vec4)
Definition: render_task.cpp:317
void render() const
perform the render step to the currently bound framebuffer
Definition: render_task.cpp:107
void set_uniform_rgba(const std::string &uniform_name, RGBA value)
register a color as RGBA that will be handed to a shader uniform of the given name during render
Definition: render_task.cpp:202
RGBA get_uniform_rgba(const std::string &uniform_name) const
access currently registered color (vec4)
Definition: render_task.cpp:302
void set_uniform_uint(const std::string &uniform_name, glm::uint value)
register an unsigned integer that will be handed to a shader uniform of the given name during render
Definition: render_task.cpp:162
Vector4f get_uniform_vec4(const std::string &uniform_name) const
access currently registered vec4
Definition: render_task.cpp:288
void set_uniform_vec3(const std::string &uniform_name, Vector3f value)
register a Vector3f that will be handed to a shader uniform of the given name during render
Definition: render_task.cpp:178
void set_uniform_int(const std::string &uniform_name, int value)
register an int that will be handed to a shader uniform of the given name during render
Definition: render_task.cpp:154
~RenderTask()
destructor
Definition: render_task.cpp:99
void set_uniform_vec2(const std::string &uniform_name, Vector2f value)
register a Vector2f that will be handed to a shader uniform of the given name during render
Definition: render_task.cpp:170
Vector2f get_uniform_vec2(const std::string &uniform_name) const
access currently registered vec2
Definition: render_task.cpp:260
void set_uniform_transform(const std::string &uniform_name, GLTransform value)
register a transform that will be handed to a shader uniform of the given name during render
Definition: render_task.cpp:194
uint32_t get_uniform_uint(const std::string &uniform_name) const
access currently registered uint
Definition: render_task.cpp:246
shader, holds the OpenGL shader program, a vertex and a fragment shader
Definition: shader.hpp:50
opengl shape primitive, variable number of vertices
Definition: shape.hpp:103
object that can emit GLib signals \for_internal_use_only
Definition: signal_emitter.hpp:48
color representation in HSVA
Definition: color.hpp:76
color representation in RGBA
Definition: color.hpp:24