Clutter.ShaderEffect

g Clutter.ActorMeta Clutter.ActorMeta Clutter.Effect Clutter.Effect Clutter.ActorMeta->Clutter.Effect Clutter.OffscreenEffect Clutter.OffscreenEffect Clutter.Effect->Clutter.OffscreenEffect Clutter.ShaderEffect Clutter.ShaderEffect Clutter.OffscreenEffect->Clutter.ShaderEffect GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Clutter.ActorMeta GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned

Subclasses:

None

Methods

Inherited:

Clutter.OffscreenEffect (6), Clutter.Effect (1), Clutter.ActorMeta (5), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (shader_type)

get_program ()

get_shader ()

set_shader_source (source)

set_uniform_value (name, value)

Virtual Methods

Inherited:

Clutter.OffscreenEffect (2), Clutter.Effect (5), Clutter.ActorMeta (1), GObject.Object (7)

do_get_static_shader_source ()

Properties

Inherited:

Clutter.ActorMeta (3)

Name

Type

Flags

Short Description

shader-type

Clutter.ShaderType

w/co

The type of shader used

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Clutter.OffscreenEffect

r

Class Details

class Clutter.ShaderEffect(**kwargs)
Bases:

Clutter.OffscreenEffect

Abstract:

No

Structure:

Clutter.ShaderEffectClass

The Clutter.ShaderEffect structure contains only private data and should be accessed using the provided API

New in version 1.4.

classmethod new(shader_type)
Parameters:

shader_type (Clutter.ShaderType) – the type of the shader, either Clutter.ShaderType.FRAGMENT_SHADER, or Clutter.ShaderType.VERTEX_SHADER

Returns:

the newly created Clutter.ShaderEffect. Use GObject.Object.unref() when done.

Return 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.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:

object

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:

object

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:

bool

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:

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 accepts GObject.TYPE_DOUBLE for compatibility with other languages than C.

New in version 1.4.

do_get_static_shader_source() virtual
Return type:

str

Property Details

Clutter.ShaderEffect.props.shader_type
Name:

shader-type

Type:

Clutter.ShaderType

Default Value:

Clutter.ShaderType.FRAGMENT_SHADER

Flags:

WRITABLE, CONSTRUCT_ONLY

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.