Clutter.ShaderEffect¶
- Subclasses:
None
Methods¶
- Inherited:
Clutter.OffscreenEffect (6), Clutter.Effect (1), Clutter.ActorMeta (5), GObject.Object (37)
- Structs:
class |
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Clutter.OffscreenEffect (2), Clutter.Effect (5), Clutter.ActorMeta (1), GObject.Object (7)
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
w/co |
The type of shader used |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Clutter.ShaderEffect(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
Clutter.ShaderEffect
structure contains only private data and should be accessed using the provided APINew in version 1.4.
- classmethod new(shader_type)¶
- Parameters:
shader_type (
Clutter.ShaderType
) – the type of the shader, eitherClutter.ShaderType.FRAGMENT_SHADER
, orClutter.ShaderType.VERTEX_SHADER
- Returns:
the newly created
Clutter.ShaderEffect
. UseGObject.Object.unref
() when done.- Return type:
Creates a new
Clutter.ShaderEffect
, to be applied to an actor usingClutter.Actor.add_effect
().The effect will be empty until
Clutter.ShaderEffect.set_shader_source
() is called.New in version 1.8.
- get_program()¶
- Returns:
a pointer to the program’s handle, or %COGL_INVALID_HANDLE
- Return type:
Retrieves a pointer to the program’s handle
New in version 1.4.
- get_shader()¶
- Returns:
a pointer to the shader’s handle, or %COGL_INVALID_HANDLE
- Return type:
Retrieves a pointer to the shader’s handle
New in version 1.4.
- set_shader_source(source)¶
- Parameters:
source (
str
) – the source of a GLSL shader- Returns:
True
if the source was set- Return type:
Sets the source of the GLSL shader used by self
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.
New in version 1.4.
- set_uniform_value(name, value)¶
- Parameters:
name (
str
) – the name of the uniform to setvalue (
GObject.Value
) – aGObject.Value
with the value of the uniform to set
Sets value as the payload for the uniform name inside the shader effect
The
GObject.GType
of the value must be one of:GObject.TYPE_INT
, for a single integer value;GObject.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 acceptsGObject.TYPE_DOUBLE
for compatibility with other languages than C.New in version 1.4.
Property Details¶
- Clutter.ShaderEffect.props.shader_type¶
- Name:
shader-type
- Type:
- Default Value:
- Flags:
The type of shader that is used by the effect. This property should be set by the constructor of
Clutter.ShaderEffect
sub-classes.New in version 1.4.