Class: Clutter::ShaderEffect
- Inherits:
-
OffscreenEffect
- Object
- GObject::InitiallyUnowned
- ActorMeta
- Effect
- OffscreenEffect
- Clutter::ShaderEffect
- Defined in:
- (unknown)
Overview
The Clutter::ShaderEffectClass structure contains only private data
Instance Method Summary collapse
-
#initialize(shader_type) ⇒ Clutter::Effect
constructor
Creates a new Clutter::ShaderEffect, to be applied to an actor using clutter_actor_add_effect().
-
#program ⇒ Cogl::Handle
Retrieves a pointer to the program's handle.
-
#set_uniform(name, gtype, n_values, array) ⇒ nil
Sets a list of values as the payload for the uniform name inside the shader effect.
-
#set_uniform_value(name, value) ⇒ nil
Sets value as the payload for the uniform name inside the shader effect.
-
#shader ⇒ Cogl::Handle
Retrieves a pointer to the shader's handle.
-
#shader_source=(source) ⇒ Boolean
Sets the source of the GLSL shader used by effect.
-
#shader_type=(shader_type) ⇒ Clutter::ShaderType
The type of shader that is used by the effect.
Methods inherited from OffscreenEffect
#create_texture, #get_target_rect, #get_target_size, #paint_target, #target, #texture
Methods inherited from Effect
Methods inherited from ActorMeta
#actor, #actor=, #enabled, #enabled=, #enabled?, #name, #name=
Constructor Details
#initialize(shader_type) ⇒ Clutter::Effect
Creates a new Clutter::ShaderEffect, to be applied to an actor using clutter_actor_add_effect().
The effect will be empty until clutter_shader_effect_set_shader_source() is called.
Instance Method Details
#program ⇒ Cogl::Handle
Retrieves a pointer to the program's handle
#set_uniform(name, gtype, n_values, array) ⇒ nil
Sets a list of values as the payload for the uniform name inside the shader effect
The gtype must be one of: %G_TYPE_INT, for 1 or more integer values; %G_TYPE_FLOAT, for 1 or more floating point values; %CLUTTER_TYPE_SHADER_INT, for a pointer to an array of integer values; %CLUTTER_TYPE_SHADER_FLOAT, for a pointer to an array of floating point values; and %CLUTTER_TYPE_SHADER_MATRIX, for a pointer to an array of floating point values mapping a matrix
The number of values interepreted is defined by the n_value argument, and by the gtype argument. For instance, a uniform named "sampler0" and containing a single integer value is set using:
clutter_shader_effect_set_uniform (effect, "map",
CLUTTER_TYPE_SHADER_MATRIX, 1,
cogl_matrix_get_array (&matrix));
#set_uniform_value(name, value) ⇒ nil
Sets value as the payload for the uniform name inside the shader effect
The #GType 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.
#shader ⇒ Cogl::Handle
Retrieves a pointer to the shader's handle
#shader_source=(source) ⇒ Boolean
Sets the source of the GLSL shader used by effect
This function should only be called by implementations of the Clutter::ShaderEffect class, and not by application code.
This function can only be called once; subsequent calls will yield no result.
#shader_type=(shader_type) ⇒ Clutter::ShaderType
The type of shader that is used by the effect. This property should be set by the constructor of Clutter::ShaderEffect sub-classes.