mousetrap v0.2.0
Loading...
Searching...
No Matches
mousetrap::RenderTask Class Reference

bundles a shape in a render task that can be invoked more conveniently during the render cycle More...

#include <render_task.hpp>

Inheritance diagram for mousetrap::RenderTask:
mousetrap::SignalEmitter

Public Member Functions

 RenderTask (const Shape &shape, const Shader *shader=nullptr, const GLTransform &transform=GLTransform(), BlendMode blend_mode=BlendMode::NORMAL)
 construct the render task
 
 RenderTask (detail::RenderTaskInternal *)
 create from gobject \for_internal_use_only
 
 ~RenderTask ()
 destructor
 
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
 
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
 
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
 
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
 
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
 
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
 
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
 
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
 
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
 
float get_uniform_float (const std::string &uniform_name) const
 access currently registered float
 
int32_t get_uniform_int (const std::string &uniform_name) const
 access currently registered int
 
uint32_t get_uniform_uint (const std::string &uniform_name) const
 access currently registered uint
 
Vector2f get_uniform_vec2 (const std::string &uniform_name) const
 access currently registered vec2
 
Vector3f get_uniform_vec3 (const std::string &uniform_name) const
 access currently registered vec3
 
Vector4f get_uniform_vec4 (const std::string &uniform_name) const
 access currently registered vec4
 
GLTransform get_uniform_transform (const std::string &uniform_name) const
 access currently registered transform (mat4x4)
 
RGBA get_uniform_rgba (const std::string &uniform_name) const
 access currently registered color (vec4)
 
HSVA get_uniform_hsva (const std::string &uniform_name) const
 access currently registered color (vec4)
 
void render () const
 perform the render step to the currently bound framebuffer
 
 operator GObject * () const override
 expose as GObject \for_internal_use_only
 
- Public Member Functions inherited from mousetrap::SignalEmitter
void set_signal_blocked (const std::string &signal_id, bool b)
 block a signal by id \for_internal_use_only
 
bool get_signal_blocked (const std::string &signal_id) const
 get whether a signal is currently blocked
 
std::vector< std::string > get_all_signal_names ()
 get list of possible signal ids \for_internal_use_only
 
template<typename Function_t >
void connect_signal (const std::string &signal_id, Function_t *function, void *data=nullptr)
 connect static function to signal, does not work with lambdas \for_internal_use_only
 
void disconnect_signal (const std::string &signal_id)
 disconnect signal, it may not be invoked until reconnected, if signal is not registered, does nothing. For internal use only
 
virtual operator NativeObject () const =0
 expose as NativeObject, this is the GLib instance that signals are emitted on \for_internal_use_only
 
virtual NativeObject get_internal () const
 expose internally managed object, \for_internal_use_only
 

Additional Inherited Members

- Protected Member Functions inherited from mousetrap::SignalEmitter
 SignalEmitter ()
 ctor
 
 ~SignalEmitter ()
 destructor
 

Detailed Description

bundles a shape in a render task that can be invoked more conveniently during the render cycle

Constructor & Destructor Documentation

◆ RenderTask()

mousetrap::RenderTask::RenderTask ( const Shape shape,
const Shader shader = nullptr,
const GLTransform transform = GLTransform(),
BlendMode  blend_mode = BlendMode::NORMAL 
)
explicit

construct the render task

Parameters
shapeshape to render
shadershader to apply to the shape when rendering, if nullptr, the default shader is used
transformtransform to hand to the vertex shader when rendering, if nullptr, the identity transform will be handed isntead
blend_modeblend_mode to set before rendering the shape, normal alpha-blending if unspecified

Member Function Documentation

◆ get_uniform_float()

float mousetrap::RenderTask::get_uniform_float ( const std::string &  uniform_name) const

access currently registered float

Parameters
uniform_name
Returns
float

References mousetrap::log::critical().

◆ get_uniform_hsva()

HSVA mousetrap::RenderTask::get_uniform_hsva ( const std::string &  uniform_name) const

access currently registered color (vec4)

Parameters
uniform_name
Returns
HSVA

References mousetrap::log::critical().

◆ get_uniform_int()

glm::int32_t mousetrap::RenderTask::get_uniform_int ( const std::string &  uniform_name) const

access currently registered int

Parameters
uniform_name
Returns
int32_t

References mousetrap::log::critical().

◆ get_uniform_rgba()

RGBA mousetrap::RenderTask::get_uniform_rgba ( const std::string &  uniform_name) const

access currently registered color (vec4)

Parameters
uniform_name
Returns
RGBA

References mousetrap::log::critical().

◆ get_uniform_transform()

GLTransform mousetrap::RenderTask::get_uniform_transform ( const std::string &  uniform_name) const

access currently registered transform (mat4x4)

Parameters
uniform_name
Returns
GLTransform

References mousetrap::log::critical().

◆ get_uniform_uint()

glm::uint mousetrap::RenderTask::get_uniform_uint ( const std::string &  uniform_name) const

access currently registered uint

Parameters
uniform_name
Returns
uint32_t

References mousetrap::log::critical().

◆ get_uniform_vec2()

Vector2f mousetrap::RenderTask::get_uniform_vec2 ( const std::string &  uniform_name) const

access currently registered vec2

Parameters
uniform_name
Returns
Vector2f

References mousetrap::log::critical().

◆ get_uniform_vec3()

Vector3f mousetrap::RenderTask::get_uniform_vec3 ( const std::string &  uniform_name) const

access currently registered vec3

Parameters
uniform_name
Returns
Vector3f

References mousetrap::log::critical().

◆ get_uniform_vec4()

Vector4f mousetrap::RenderTask::get_uniform_vec4 ( const std::string &  uniform_name) const

access currently registered vec4

Parameters
uniform_name
Returns
Vector4f

References mousetrap::log::critical().

◆ set_uniform_float()

void mousetrap::RenderTask::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

Parameters
uniform_namename of the uniform variable in the glsl shader code, has to be of type float
pointerpointer to value, the user is responsible for keeping it in scope
value

◆ set_uniform_hsva()

void mousetrap::RenderTask::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

Parameters
uniform_namename of the uniform variable in the glsl shader code, has to be of type vec4
value

References set_uniform_vec4().

◆ set_uniform_int()

void mousetrap::RenderTask::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

Parameters
uniform_namename of the uniform variable in the glsl shader code, has to be of type int
value

◆ set_uniform_rgba()

void mousetrap::RenderTask::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

Parameters
uniform_namename of the uniform variable in the glsl shader code, has to be of type vec4
value

References set_uniform_vec4().

◆ set_uniform_transform()

void mousetrap::RenderTask::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

Parameters
uniform_namename of the uniform variable in the glsl shader code, has to be of type mat4x4
value

◆ set_uniform_uint()

void mousetrap::RenderTask::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

Parameters
uniform_namename of the uniform variable in the glsl shader code, has to be of type uint
value

◆ set_uniform_vec2()

void mousetrap::RenderTask::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

Parameters
uniform_namename of the uniform variable in the glsl shader code, has to be of type vec2
value

◆ set_uniform_vec3()

void mousetrap::RenderTask::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

Parameters
uniform_namename of the uniform variable in the glsl shader code, has to be of type vec3
value

◆ set_uniform_vec4()

void mousetrap::RenderTask::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

Parameters
uniform_namename of the uniform variable in the glsl shader code, has to be of type vec4
value

Referenced by set_uniform_hsva(), and set_uniform_rgba().


The documentation for this class was generated from the following files: