cluttermm: Clutter::Shader Class Reference

Inheritance diagram for Clutter::Shader:
Collaboration diagram for Clutter::Shader:

Public Member Functions

virtual ~Shader ()
 
ClutterShader* gobj ()
 Provides access to the underlying C GObject. More...

 
const ClutterShader* gobj () const
 Provides access to the underlying C GObject. More...

 
ClutterShader* gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...

 
void set_vertex_source (const std::string& source_code)
 Sets the GLSL source code to be used by a Shader for the vertex program. More...

 
std::string get_vertex_source () const
 Query the current GLSL vertex source set on shader. More...

 
void set_fragment_source (const std::string& source_code)
 Sets the GLSL source code to be used by a Shader for the fragment program. More...

 
std::string get_fragment_source () const
 Query the current GLSL fragment source set on shader. More...

 
bool compile ()
 Compiles and links GLSL sources set for vertex and fragment shaders for a Clutter::Shader. More...

 
bool is_compiled () const
 Checks whether shader is is currently compiled, linked and bound to the GL context. More...

 
void release ()
 Frees up any GL context resources held by the shader. More...

 
void set_is_enabled (bool enabled=true)
 Enables a shader. More...

 
bool get_is_enabled () const
 Checks whether shader is enabled. More...

 
void set_uniform (const Glib::ustring& name, const Glib::ValueBase& value)
 Sets a user configurable variable in the GLSL shader programs attached to a Clutter::Shader. More...

 
CoglHandle get_cogl_program () const
 Retrieves the underlying Cogl::Handle for the shader program. More...

 
CoglHandle get_cogl_vertex_shader () const
 Retrieves the underlying Cogl::Handle for the vertex shader. More...

 
CoglHandle get_cogl_fragment_shader () const
 Retrieves the underlying Cogl::Handle for the fragment shader. More...

 
Glib::PropertyProxy_ReadOnly

< bool > 
property_compiled () const
 Whether the shader is compiled and linked. More...

 
Glib::PropertyProxy< bool > property_enabled ()
 Whether the shader is enabled. More...

 
Glib::PropertyProxy_ReadOnly

< bool > 
property_enabled () const
 Whether the shader is enabled. More...

 
Glib::PropertyProxy< std::stringproperty_fragment_source ()
 Source of fragment shader. More...

 
Glib::PropertyProxy_ReadOnly

< std::string
property_fragment_source () const
 Source of fragment shader. More...

 
Glib::PropertyProxy< std::stringproperty_vertex_source ()
 Source of vertex shader. More...

 
Glib::PropertyProxy_ReadOnly

< std::string
property_vertex_source () const
 Source of vertex shader. More...

 

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...

 
static Glib::RefPtr< Shadercreate ()
 

Protected Member Functions

 Shader ()
 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Clutter::Shaderwrap (ClutterShader* object, bool take_copy=false)
 A Glib::wrap() method for this object. More...

 

Detailed Description

Constructor & Destructor Documentation

virtual Clutter::Shader::~Shader ( )
virtual
Clutter::Shader::Shader ( )
protected

Member Function Documentation

bool Clutter::Shader::compile ( )

Compiles and links GLSL sources set for vertex and fragment shaders for a Clutter::Shader.

If the compilation fails and a Error return location is provided the error will contain the errors from the compiler, if any.

Since cluttermm 0.8:

Deprecated: 1.8: Use Clutter::ShaderEffect instead.

Returns
Returns true if the shader was succesfully compiled.
static Glib::RefPtr<Shader> Clutter::Shader::create ( )
static
CoglHandle Clutter::Shader::get_cogl_fragment_shader ( ) const

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

Since cluttermm 1.0:

Deprecated: 1.8: Use Clutter::ShaderEffect instead.

Returns
A Cogl::Handle for the fragment shader, or 0. The handle is owned by the Clutter::Shader and it should not be unreferenced.
CoglHandle Clutter::Shader::get_cogl_program ( ) const

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

Since cluttermm 1.0:

Deprecated: 1.8: Use Clutter::ShaderEffect instead.

Returns
A Cogl::Handle for the shader program, or 0. The handle is owned by the Clutter::Shader and it should not be unreferenced.
CoglHandle Clutter::Shader::get_cogl_vertex_shader ( ) const

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

Since cluttermm 1.0:

Deprecated: 1.8: Use Clutter::ShaderEffect instead.

Returns
A Cogl::Handle for the vertex shader, or 0. The handle is owned by the Clutter::Shader and it should not be unreferenced.
std::string Clutter::Shader::get_fragment_source ( ) const

Query the current GLSL fragment source set on shader.

Since cluttermm 0.6:

Deprecated: 1.8: Use Clutter::ShaderEffect instead.

Returns
The source of the fragment shader for this ClutterShader object or 0. The returned string is owned by the shader object and should never be modified or freed.
bool Clutter::Shader::get_is_enabled ( ) const

Checks whether shader is enabled.

Since cluttermm 0.6:

Deprecated: 1.8: Use Clutter::ShaderEffect instead.

Returns
true if the shader is enabled.
static GType Clutter::Shader::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

std::string Clutter::Shader::get_vertex_source ( ) const

Query the current GLSL vertex source set on shader.

Since cluttermm 0.6:

Deprecated: 1.8: Use Clutter::ShaderEffect instead.

Returns
The source of the vertex shader for this ClutterShader object or 0. The returned string is owned by the shader object and should never be modified or freed.
ClutterShader* Clutter::Shader::gobj ( )
inline

Provides access to the underlying C GObject.

const ClutterShader* Clutter::Shader::gobj ( ) const
inline

Provides access to the underlying C GObject.

ClutterShader* Clutter::Shader::gobj_copy ( )

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

bool Clutter::Shader::is_compiled ( ) const

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

Since cluttermm 0.8:

Deprecated: 1.8: Use Clutter::ShaderEffect instead.

Returns
true if the shader is compiled, linked and ready for use.
Glib::PropertyProxy_ReadOnly< bool > Clutter::Shader::property_compiled ( ) const

Whether the shader is compiled and linked.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy< bool > Clutter::Shader::property_enabled ( )

Whether the shader is enabled.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< bool > Clutter::Shader::property_enabled ( ) const

Whether the shader is enabled.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy< std::string > Clutter::Shader::property_fragment_source ( )

Source of fragment shader.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< std::string > Clutter::Shader::property_fragment_source ( ) const

Source of fragment shader.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy< std::string > Clutter::Shader::property_vertex_source ( )

Source of vertex shader.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< std::string > Clutter::Shader::property_vertex_source ( ) const

Source of vertex shader.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
void Clutter::Shader::release ( )

Frees up any GL context resources held by the shader.

Since cluttermm 0.6:

Deprecated: 1.8: Use Clutter::ShaderEffect instead.

void Clutter::Shader::set_fragment_source ( const std::string source_code)

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

Parameters
source_codeThe GLSL source code.
void Clutter::Shader::set_is_enabled ( bool  enabled = true)

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.

Since cluttermm 0.6:

Deprecated: 1.8: Use Clutter::ShaderEffect instead.

Parameters
enabledThe new state of the shader.
void Clutter::Shader::set_uniform ( const Glib::ustring name,
const Glib::ValueBase value 
)

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

Since cluttermm 1.0:

Deprecated: 1.8: Use Clutter::ShaderEffect instead.

Parameters
nameName of uniform in GLSL shader program to set.
valueA Clutter::ShaderFloat, Clutter::ShaderInt or Clutter::ShaderMatrix Value.
void Clutter::Shader::set_vertex_source ( const std::string source_code)

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

Parameters
source_codeThe GLSL source code.

Friends And Related Function Documentation

Glib::RefPtr< Clutter::Shader > wrap ( ClutterShader *  object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:
  • cluttermm/shader.h