Class: Clutter::Shader

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Overview

The Clutter::ShaderClass structure contains only private data

Instance Method Summary collapse

Constructor Details

#initializeClutter::Shader

Create a new Clutter::Shader instance.

Instance Method Details

#cogl_fragment_shaderCogl::Handle

Retrieves the underlying Cogl::Handle for the fragment shader.

Returns:

  • (Cogl::Handle)

    A Cogl::Handle for the fragment
    shader, or nil. The handle is owned by the Clutter::Shader
    and it should not be unreferenced

#cogl_programCogl::Handle

Retrieves the underlying Cogl::Handle for the shader program.

Returns:

  • (Cogl::Handle)

    A Cogl::Handle for the shader program,
    or nil. The handle is owned by the Clutter::Shader and it should
    not be unreferenced

#cogl_vertex_shaderCogl::Handle

Retrieves the underlying Cogl::Handle for the vertex shader.

Returns:

  • (Cogl::Handle)

    A Cogl::Handle for the vertex
    shader, or nil. The handle is owned by the Clutter::Shader
    and it should not be unreferenced

#compileBoolean

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

Returns:

  • (Boolean)

    returns TRUE if the shader was succesfully compiled.

#compiled=(compiled) ⇒ Boolean

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

Parameters:

  • compiled (Boolean)

Returns:

  • (Boolean)

    compiled

  • (Boolean)

    compiled

#compiled?Boolean

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

Returns:

  • (Boolean)

    compiled

#enabled=(enabled) ⇒ Boolean

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

Parameters:

  • enabled (Boolean)

Returns:

  • (Boolean)

    enabled

  • (Boolean)

    enabled

#enabled?Boolean

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

Returns:

  • (Boolean)

    enabled

#fragment_sourceString

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

Returns:

  • (String)

    fragment-source

#fragment_source=(fragment_source) ⇒ String

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

Parameters:

  • fragment_source (String)

Returns:

  • (String)

    fragment-source

  • (String)

    fragment-source

#is_compiledBoolean

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

Returns:

  • (Boolean)

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

#is_enabledBoolean

Checks whether shader is enabled.

Returns:

  • (Boolean)

    true if the shader is enabled.

#is_enabled=(enabled) ⇒ nil

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.

Parameters:

  • enabled (Boolean)

    The new state of the shader.

Returns:

  • (nil)

#releasenil

Frees up any GL context resources held by the shader.

Returns:

  • (nil)

#set_fragment_source(data, length) ⇒ nil

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

Parameters:

  • data (String)

    GLSL source code.

  • length (Clutter::gssize)

    length of source buffer (currently ignored)

Returns:

  • (nil)

#set_uniform(name, value) ⇒ nil

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

Parameters:

  • name (String)

    name of uniform in GLSL shader program to set.

  • value (GObject::Value)

    a Clutter::ShaderFloat, #ClutterShaderInt or #ClutterShaderMatrix
    #GValue.

Returns:

  • (nil)

#set_vertex_source(data, length) ⇒ nil

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

Parameters:

  • data (String)

    GLSL source code.

  • length (Clutter::gssize)

    length of source buffer (currently ignored)

Returns:

  • (nil)

#vertex_sourceString

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

Returns:

  • (String)

    vertex-source

#vertex_source=(vertex_source) ⇒ String

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

Parameters:

  • vertex_source (String)

Returns:

  • (String)

    vertex-source

  • (String)

    vertex-source