Make clutter_shader_effect_set_uniform_value accept G_TYPE_DOUBLE
For users of gobject-introspection that cannot know which non-integer type to pass. http://bugzilla.clutter-project.org/show_bug.cgi?id=2471
This commit is contained in:
parent
cf1fced885
commit
b6318bd821
@ -238,6 +238,15 @@ clutter_shader_effect_update_uniforms (ClutterShaderEffect *effect)
|
|||||||
{
|
{
|
||||||
const GLfloat float_val = g_value_get_float (&uniform->value);
|
const GLfloat float_val = g_value_get_float (&uniform->value);
|
||||||
|
|
||||||
|
cogl_program_set_uniform_float (priv->program, uniform->location,
|
||||||
|
1, 1,
|
||||||
|
&float_val);
|
||||||
|
}
|
||||||
|
else if (G_VALUE_HOLDS_DOUBLE (&uniform->value))
|
||||||
|
{
|
||||||
|
const GLfloat float_val =
|
||||||
|
(GLfloat) g_value_get_double (&uniform->value);
|
||||||
|
|
||||||
cogl_program_set_uniform_float (priv->program, uniform->location,
|
cogl_program_set_uniform_float (priv->program, uniform->location,
|
||||||
1, 1,
|
1, 1,
|
||||||
&float_val);
|
&float_val);
|
||||||
@ -554,7 +563,8 @@ clutter_shader_effect_add_uniform (ClutterShaderEffect *effect,
|
|||||||
* %CLUTTER_TYPE_SHADER_INT, for an array of integer values;
|
* %CLUTTER_TYPE_SHADER_INT, for an array of integer values;
|
||||||
* %CLUTTER_TYPE_SHADER_FLOAT, for an array of floating point values;
|
* %CLUTTER_TYPE_SHADER_FLOAT, for an array of floating point values;
|
||||||
* and %CLUTTER_TYPE_SHADER_MATRIX, for a matrix of floating point
|
* and %CLUTTER_TYPE_SHADER_MATRIX, for a matrix of floating point
|
||||||
* values
|
* values. It also accepts %G_TYPE_DOUBLE for compatibility with other
|
||||||
|
* languages than C.
|
||||||
*
|
*
|
||||||
* Since: 1.4
|
* Since: 1.4
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user