pub trait ShaderEffectExt: 'static {
// Required methods
fn set_shader_source(&self, source: &str) -> bool;
fn set_uniform_value(&self, name: &str, value: &Value);
}
Expand description
Required Methods§
Sourcefn set_shader_source(&self, source: &str) -> bool
fn set_shader_source(&self, source: &str) -> bool
Sets the source of the GLSL shader used by self
This function should only be called by implementations of
the ShaderEffect
class, and not by application code.
This function can only be called once; subsequent calls will yield no result.
§source
the source of a GLSL shader
§Returns
true
if the source was set
Sourcefn set_uniform_value(&self, name: &str, value: &Value)
fn set_uniform_value(&self, name: &str, value: &Value)
Sets value
as the payload for the uniform name
inside the shader
effect
The glib::Type
of the value
must be one of: G_TYPE_INT
, for a single
integer value; G_TYPE_FLOAT
, for a single floating point value;
CLUTTER_TYPE_SHADER_INT
, for an array of integer values;
CLUTTER_TYPE_SHADER_FLOAT
, for an array of floating point values;
and CLUTTER_TYPE_SHADER_MATRIX
, for a matrix of floating point
values. It also accepts G_TYPE_DOUBLE
for compatibility with other
languages than C.
§name
the name of the uniform to set
§value
a gobject::Value
with the value of the uniform to set