Clutter.Shader¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
Whether the shader is compiled and linked |
||
r/w |
Whether the shader is enabled |
||
r/w |
Source of fragment shader |
||
r/w |
Source of vertex shader |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Clutter.Shader(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
Clutter.Shader
structure contains only private data and should be accessed using the provided APINew in version 0.6.
Deprecated since version 1.8: Use
Clutter.ShaderEffect
instead- classmethod new()¶
- Returns:
a new
Clutter.Shader
.- Return type:
Create a new
Clutter.Shader
instance.New in version 0.6.
Deprecated since version 1.8: Use
Clutter.ShaderEffect
instead.
- compile()¶
- Raises:
- Returns:
returns
True
if the shader was succesfully compiled.- Return type:
Compiles and links GLSL sources set for vertex and fragment shaders for a
Clutter.Shader
. If the compilation fails and aGLib.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 theClutter.Shader
and it should not be unreferenced- Return type:
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 theClutter.Shader
and it should not be unreferenced- Return type:
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 theClutter.Shader
and it should not be unreferenced- Return type:
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 orNone
. The returned string is owned by the shader object and should never be modified or freed- Return type:
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()¶
-
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 orNone
. The returned string is owned by the shader object and should never be modified or freed- Return type:
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()¶
-
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:
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:
name (
str
) – name of uniform in GLSL shader program to set.value (
GObject.Value
) – aClutter.ShaderFloat
,Clutter.ShaderInt
orClutter.ShaderMatrix
GObject.Value
.
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:
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¶
-
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¶
-
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¶
-
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.