Next: ClutterStage, Previous: ClutterScript, Up: Top
Programmable pipeline abstraction
<clutter-shader> is an object providing an abstraction over the OpenGL
programmable pipeline. By using <clutter-shader>s is possible to override
the drawing pipeline by using small programs also known as "shaders".
<clutter-shader> is available since Clutter 0.6
Derives from
<gobject>.This class defines the following slots:
vertex-source- Source of vertex shader
fragment-source- Source of fragment shader
compiled- Whether the shader is compiled and linked
enabled- Whether the shader is enabled
<clutter-shader>)Create a new
<clutter-shader>instance.
- ret
- a new
<clutter-shader>.Since 0.6
<clutter-shader>) (data mchars) (length ssize_t)Sets the GLSL source code to be used by a
<clutter-shader>for the vertex program.
- shader
- a
<clutter-shader>- data
- GLSL source code.
- length
- length of source buffer (currently ignored)
Since 0.6
<clutter-shader>) (ret mchars)Query the current GLSL vertex source set on shader.
- shader
- a
<clutter-shader>- ret
- the source of the vertex shader for this ClutterShader object or ‘
#f’. The returned string is owned by the shader object and should never be modified or freedSince 0.6
<clutter-shader>) (data mchars) (length ssize_t)Sets the GLSL source code to be used by a
<clutter-shader>for the fragment program.
- shader
- a
<clutter-shader>- data
- GLSL source code.
- length
- length of source buffer (currently ignored)
Since 0.6
<clutter-shader>) (ret mchars)Query the current GLSL fragment source set on shader.
- shader
- a
<clutter-shader>- ret
- the source of the fragment shader for this ClutterShader object or ‘
#f’. The returned string is owned by the shader object and should never be modified or freedSince 0.6
<clutter-shader>) (ret bool)Compiles and links GLSL sources set for vertex and fragment shaders for a
<clutter-shader>. If the compilation fails and a<g-error>return location is provided the error will contain the errors from the compiler, if any.
- shader
- a
<clutter-shader>- error
- return location for a
<g-error>, or ‘#f’- ret
- returns TRUE if the shader was succesfully compiled.
Since 0.8
<clutter-shader>)Frees up any GL context resources held by the shader.
- shader
- a
<clutter-shader>Since 0.6
<clutter-shader>) (ret bool)Checks whether shader is is currently compiled, linked and bound to the GL context.
- shader
- a
<clutter-shader>- ret
- ‘
#t’ if the shader is compiled, linked and ready for use.Since 0.8
<clutter-shader>) (enabled bool)Enables a shader. This function will attempt to compile and link the shader, if it isn't already.
When enabled is ‘
#f’ the default state of the GL pipeline will be used instead.
- shader
- a
<clutter-shader>- enabled
- The new state of the shader.
Since 0.6
<clutter-shader>) (ret bool)Checks whether shader is enabled.
- shader
- a
<clutter-shader>- ret
- ‘
#t’ if the shader is enabled.Since 0.6
<clutter-shader>) (name mchars) (value float)Sets a user configurable variable in the shader programs attached to a
<clutter-shader>.
- shader
- a
<clutter-shader>- name
- name of uniform in vertex or fragment program to set.
- value
- the new value of the uniform.
Since 0.6