4 * An OpenGL based 'interactive canvas' library.
6 * Copyright (C) 2010 Intel Corporation.
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
22 * Emmanuele Bassi <ebassi@linux.intel.com>
25 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
26 #error "Only <clutter/clutter.h> can be included directly."
29 #ifndef __CLUTTER_SHADER_EFFECT_H__
30 #define __CLUTTER_SHADER_EFFECT_H__
32 #include <clutter/clutter-offscreen-effect.h>
36 #define CLUTTER_TYPE_SHADER_EFFECT (clutter_shader_effect_get_type ())
37 #define CLUTTER_SHADER_EFFECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_SHADER_EFFECT, ClutterShaderEffect))
38 #define CLUTTER_IS_SHADER_EFFECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_SHADER_EFFECT))
39 #define CLUTTER_SHADER_EFFECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_SHADER_EFFECT, ClutterShaderEffectClass))
40 #define CLUTTER_IS_SHADER_EFFECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_SHADER_EFFECT))
41 #define CLUTTER_SHADER_EFFECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_SHADER_EFFECT, ClutterShaderEffectClass))
43 typedef struct _ClutterShaderEffect ClutterShaderEffect;
44 typedef struct _ClutterShaderEffectPrivate ClutterShaderEffectPrivate;
45 typedef struct _ClutterShaderEffectClass ClutterShaderEffectClass;
48 * ClutterShaderEffect:
50 * The <structname>ClutterShaderEffect</structname> structure contains
51 * only private data and should be accessed using the provided API
55 struct _ClutterShaderEffect
58 ClutterOffscreenEffect parent_instance;
60 ClutterShaderEffectPrivate *priv;
64 * ClutterShaderEffectClass:
65 * @get_static_shader_source: Returns the GLSL source code to use for
66 * instances of this shader effect. Note that this function is only
67 * called once per subclass of #ClutterShaderEffect regardless of how
68 * many instances are used. It is expected that subclasses will return
69 * a copy of a static string from this function.
71 * The <structname>ClutterShaderEffectClass</structname> structure contains
76 struct _ClutterShaderEffectClass
79 ClutterOffscreenEffectClass parent_class;
82 gchar * (* get_static_shader_source) (ClutterShaderEffect *effect);
86 void (*_clutter_shader1) (void);
87 void (*_clutter_shader2) (void);
88 void (*_clutter_shader3) (void);
89 void (*_clutter_shader4) (void);
90 void (*_clutter_shader5) (void);
93 GType clutter_shader_effect_get_type (void) G_GNUC_CONST;
95 ClutterEffect * clutter_shader_effect_new (ClutterShaderType shader_type);
97 gboolean clutter_shader_effect_set_shader_source (ClutterShaderEffect *effect,
100 void clutter_shader_effect_set_uniform (ClutterShaderEffect *effect,
105 void clutter_shader_effect_set_uniform_value (ClutterShaderEffect *effect,
107 const GValue *value);
109 CoglHandle clutter_shader_effect_get_shader (ClutterShaderEffect *effect);
110 CoglHandle clutter_shader_effect_get_program (ClutterShaderEffect *effect);
114 #endif /* __CLUTTER_SHADER_EFFECT_H__ */