Clutter.Shader

g Clutter.Shader Clutter.Shader GObject.Object GObject.Object GObject.Object->Clutter.Shader

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

compile ()

get_cogl_fragment_shader ()

get_cogl_program ()

get_cogl_vertex_shader ()

get_fragment_source ()

get_is_enabled ()

get_vertex_source ()

is_compiled ()

release ()

set_fragment_source (data, length)

set_is_enabled (enabled)

set_uniform (name, value)

set_vertex_source (data, length)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

compiled

bool

r

Whether the shader is compiled and linked deprecated

enabled

bool

r/w

Whether the shader is enabled deprecated

fragment-source

str

r/w

Source of fragment shader deprecated

vertex-source

str

r/w

Source of vertex shader deprecated

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Clutter.Shader(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Clutter.ShaderClass

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

New in version 0.6.

Deprecated since version 1.8: Use Clutter.ShaderEffect instead

classmethod new()
Returns:

a new Clutter.Shader.

Return type:

Clutter.Shader

Create a new Clutter.Shader instance.

New in version 0.6.

Deprecated since version 1.8: Use Clutter.ShaderEffect instead.

compile()
Raises:

GLib.Error

Returns:

returns True if the shader was succesfully compiled.

Return type:

bool

Compiles and links GLSL sources set for vertex and fragment shaders for a Clutter.Shader. If the compilation fails and a GLib.Error return location is provided the error will contain the errors from the compiler, if any.

New in version 0.8.

Deprecated since version 1.8: Use Clutter.ShaderEffect instead.

get_cogl_fragment_shader()
Returns:

A #CoglHandle for the fragment shader, or None. The handle is owned by the Clutter.Shader and it should not be unreferenced

Return type:

object

Retrieves the underlying #CoglHandle for the fragment shader.

New in version 1.0.

Deprecated since version 1.8: Use Clutter.ShaderEffect instead.

get_cogl_program()
Returns:

A #CoglHandle for the shader program, or None. The handle is owned by the Clutter.Shader and it should not be unreferenced

Return type:

object

Retrieves the underlying #CoglHandle for the shader program.

New in version 1.0.

Deprecated since version 1.8: Use Clutter.ShaderEffect instead.

get_cogl_vertex_shader()
Returns:

A #CoglHandle for the vertex shader, or None. The handle is owned by the Clutter.Shader and it should not be unreferenced

Return type:

object

Retrieves the underlying #CoglHandle for the vertex shader.

New in version 1.0.

Deprecated since version 1.8: Use Clutter.ShaderEffect instead.

get_fragment_source()
Returns:

the source of the fragment shader for this Clutter.Shader object or None. The returned string is owned by the shader object and should never be modified or freed

Return type:

str

Query the current GLSL fragment source set on self.

New in version 0.6.

Deprecated since version 1.8: Use Clutter.ShaderEffect instead.

get_is_enabled()
Returns:

True if the shader is enabled.

Return type:

bool

Checks whether self is enabled.

New in version 0.6.

Deprecated since version 1.8: Use Clutter.ShaderEffect instead.

get_vertex_source()
Returns:

the source of the vertex shader for this Clutter.Shader object or None. The returned string is owned by the shader object and should never be modified or freed

Return type:

str

Query the current GLSL vertex source set on self.

New in version 0.6.

Deprecated since version 1.8: Use Clutter.ShaderEffect instead.

is_compiled()
Returns:

True if the shader is compiled, linked and ready for use.

Return type:

bool

Checks whether self is is currently compiled, linked and bound to the GL context.

New in version 0.8.

Deprecated since version 1.8: Use Clutter.ShaderEffect instead.

release()

Frees up any GL context resources held by the shader.

New in version 0.6.

Deprecated since version 1.8: Use Clutter.ShaderEffect instead.

set_fragment_source(data, length)
Parameters:
  • data (str) – GLSL source code.

  • length (int) – length of source buffer (currently ignored)

Sets the GLSL source code to be used by a Clutter.Shader for the fragment program.

New in version 0.6.

Deprecated since version 1.8: Use Clutter.ShaderEffect instead.

set_is_enabled(enabled)
Parameters:

enabled (bool) – The new state of the shader.

Enables a shader. This function will attempt to compile and link the shader, if it isn’t already.

When enabled is False the default state of the GL pipeline will be used instead.

New in version 0.6.

Deprecated since version 1.8: Use Clutter.ShaderEffect instead.

set_uniform(name, value)
Parameters:

Sets a user configurable variable in the GLSL shader programs attached to a Clutter.Shader.

New in version 1.0.

Deprecated since version 1.8: Use Clutter.ShaderEffect instead.

set_vertex_source(data, length)
Parameters:
  • data (str) – GLSL source code.

  • length (int) – length of source buffer (currently ignored)

Sets the GLSL source code to be used by a Clutter.Shader for the vertex program.

New in version 0.6.

Deprecated since version 1.8: Use Clutter.ShaderEffect instead.

Property Details

Clutter.Shader.props.compiled
Name:

compiled

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the shader is compiled and linked, ready for use in the GL context.

New in version 0.8.

Deprecated since version 1.8: Use Clutter.ShaderEffect instead.

Clutter.Shader.props.enabled
Name:

enabled

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Whether the shader is currently used in the GL rendering pipeline.

New in version 0.6.

Deprecated since version 1.8: Use Clutter.ShaderEffect instead.

Clutter.Shader.props.fragment_source
Name:

fragment-source

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

GLSL source code for the fragment shader part of the shader program.

New in version 0.6.

Deprecated since version 1.8: Use Clutter.ShaderEffect instead.

Clutter.Shader.props.vertex_source
Name:

vertex-source

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

GLSL source code for the vertex shader part of the shader program, if any

New in version 0.6.

Deprecated since version 1.8: Use Clutter.ShaderEffect instead.