#include <shader.h>
Public Member Functions | |
virtual | ~Shader () |
ClutterShader * | gobj () |
Provides access to the underlying C GObject. | |
const ClutterShader * | gobj () const |
Provides access to the underlying C GObject. | |
ClutterShader * | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
void | set_vertex_source (const std::string &source_code) |
Sets the GLSL source code to be used by a Shader for the vertex program. | |
std::string | get_vertex_source () const |
Query the current GLSL vertex source set on shader. | |
void | set_fragment_source (const std::string &source_code) |
Sets the GLSL source code to be used by a Shader for the fragment program. | |
std::string | get_fragment_source () const |
Query the current GLSL fragment source set on shader. | |
bool | compile () |
Compiles and links GLSL sources set for vertex and fragment shaders for a Clutter::Shader. | |
bool | is_compiled () const |
Checks whether shader is is currently compiled, linked and bound to the GL context. | |
void | release () |
Frees up any GL context resources held by the shader. | |
void | set_is_enabled (bool enabled=true) |
Enables a shader. | |
bool | get_is_enabled () const |
Checks whether shader is enabled. | |
void | set_uniform_1f (const std::string &name, float value) |
Sets a user configurable variable in the shader programs attached to a Clutter::Shader. | |
Glib::PropertyProxy_ReadOnly < bool > | property_compiled () const |
Whether the shader is compiled and linked. | |
Glib::PropertyProxy< bool > | property_enabled () |
Whether the shader is enabled. | |
Glib::PropertyProxy_ReadOnly < bool > | property_enabled () const |
Whether the shader is enabled. | |
Glib::PropertyProxy< std::string > | property_fragment_source () |
Source of fragment shader. | |
Glib::PropertyProxy_ReadOnly < std::string > | property_fragment_source () const |
Source of fragment shader. | |
Glib::PropertyProxy< std::string > | property_vertex_source () |
Source of vertex shader. | |
Glib::PropertyProxy_ReadOnly < std::string > | property_vertex_source () const |
Source of vertex shader. | |
Static Public Member Functions | |
static Glib::RefPtr< Shader > | create () |
Protected Member Functions | |
Shader () | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr< Clutter::Shader > | wrap (ClutterShader *object, bool take_copy=false) |
A Glib::wrap() method for this object. |
virtual Clutter::Shader::~Shader | ( | ) | [virtual] |
Clutter::Shader::Shader | ( | ) | [protected] |
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.
true
if the shader was succesfully compiled.static Glib::RefPtr<Shader> Clutter::Shader::create | ( | ) | [static] |
std::string Clutter::Shader::get_fragment_source | ( | ) | const |
Query the current GLSL fragment source set on shader.
0
. The returned string is owned by the shader object and should never be modified or freedbool Clutter::Shader::get_is_enabled | ( | ) | const |
Checks whether shader is enabled.
true
if the shader is enabled.std::string Clutter::Shader::get_vertex_source | ( | ) | const |
Query the current GLSL vertex source set on shader.
0
. The returned string is owned by the shader object and should never be modified or freedconst ClutterShader* Clutter::Shader::gobj | ( | ) | const [inline] |
Provides access to the underlying C GObject.
ClutterShader* Clutter::Shader::gobj | ( | ) | [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.
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.
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.
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.
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.
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.
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.
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.
void Clutter::Shader::release | ( | ) |
Frees up any GL context resources held by the shader.
Since: 0.6
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.
source_code | The 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: 0.6
enabled | The new state of the shader. |
void Clutter::Shader::set_uniform_1f | ( | const std::string & | name, | |
float | value | |||
) |
Sets a user configurable variable in the shader programs attached to a Clutter::Shader.
Since: 0.6
name | Name of uniform in vertex or fragment program to set. | |
value | The new value of the uniform. |
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.
source_code | The GLSL source code. |
Glib::RefPtr< Clutter::Shader > wrap | ( | ClutterShader * | object, | |
bool | take_copy = false | |||
) | [related] |
A Glib::wrap() method for this object.
object | The C instance. | |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |