shader.h
Go to the documentation of this file.00001
00002
00003 #ifndef _CLUTTERMM_SHADER_H
00004 #define _CLUTTERMM_SHADER_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include <glibmm/object.h>
00027 #include <clutter/clutter-shader.h>
00028
00029
00030 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00031 typedef struct _ClutterShader ClutterShader;
00032 typedef struct _ClutterShaderClass ClutterShaderClass;
00033 #endif
00034
00035
00036 namespace Clutter
00037 { class Shader_Class; }
00038 namespace Clutter
00039 {
00040
00041
00042 class Shader : public Glib::Object
00043 {
00044
00045 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00046
00047 public:
00048 typedef Shader CppObjectType;
00049 typedef Shader_Class CppClassType;
00050 typedef ClutterShader BaseObjectType;
00051 typedef ClutterShaderClass BaseClassType;
00052
00053 private: friend class Shader_Class;
00054 static CppClassType shader_class_;
00055
00056 private:
00057
00058 Shader(const Shader&);
00059 Shader& operator=(const Shader&);
00060
00061 protected:
00062 explicit Shader(const Glib::ConstructParams& construct_params);
00063 explicit Shader(ClutterShader* castitem);
00064
00065 #endif
00066
00067 public:
00068 virtual ~Shader();
00069
00070 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00071 static GType get_type() G_GNUC_CONST;
00072 static GType get_base_type() G_GNUC_CONST;
00073 #endif
00074
00076 ClutterShader* gobj() { return reinterpret_cast<ClutterShader*>(gobject_); }
00077
00079 const ClutterShader* gobj() const { return reinterpret_cast<ClutterShader*>(gobject_); }
00080
00082 ClutterShader* gobj_copy();
00083
00084 private:
00085
00086
00087 protected:
00088 Shader();
00089
00090 public:
00091
00092 static Glib::RefPtr<Shader> create();
00093
00094
00098 void set_vertex_source(const std::string& source_code);
00099
00100
00108 std::string get_vertex_source() const;
00109
00110
00115 void set_fragment_source(const std::string& source_code);
00116
00117
00125 std::string get_fragment_source() const;
00126
00127
00135 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00136 bool compile();
00137 #else
00138 bool compile(std::auto_ptr<Glib::Error>& error);
00139 #endif //GLIBMM_EXCEPTIONS_ENABLED
00140
00141
00148 bool is_compiled() const;
00149
00154 void release();
00155
00165 void set_is_enabled(bool enabled = true);
00166
00172 bool get_is_enabled() const;
00173
00174
00182 void set_uniform_1f(const std::string& name, float value);
00183
00184 #ifdef GLIBMM_PROPERTIES_ENABLED
00185
00191 Glib::PropertyProxy_ReadOnly<bool> property_compiled() const;
00192 #endif //#GLIBMM_PROPERTIES_ENABLED
00193
00194
00195 #ifdef GLIBMM_PROPERTIES_ENABLED
00196
00202 Glib::PropertyProxy<bool> property_enabled() ;
00203 #endif //#GLIBMM_PROPERTIES_ENABLED
00204
00205 #ifdef GLIBMM_PROPERTIES_ENABLED
00206
00212 Glib::PropertyProxy_ReadOnly<bool> property_enabled() const;
00213 #endif //#GLIBMM_PROPERTIES_ENABLED
00214
00215 #ifdef GLIBMM_PROPERTIES_ENABLED
00216
00222 Glib::PropertyProxy<std::string> property_fragment_source() ;
00223 #endif //#GLIBMM_PROPERTIES_ENABLED
00224
00225 #ifdef GLIBMM_PROPERTIES_ENABLED
00226
00232 Glib::PropertyProxy_ReadOnly<std::string> property_fragment_source() const;
00233 #endif //#GLIBMM_PROPERTIES_ENABLED
00234
00235 #ifdef GLIBMM_PROPERTIES_ENABLED
00236
00242 Glib::PropertyProxy<std::string> property_vertex_source() ;
00243 #endif //#GLIBMM_PROPERTIES_ENABLED
00244
00245 #ifdef GLIBMM_PROPERTIES_ENABLED
00246
00252 Glib::PropertyProxy_ReadOnly<std::string> property_vertex_source() const;
00253 #endif //#GLIBMM_PROPERTIES_ENABLED
00254
00255
00256 public:
00257
00258 public:
00259
00260 #ifdef GLIBMM_VFUNCS_ENABLED
00261 #endif //GLIBMM_VFUNCS_ENABLED
00262
00263 protected:
00264
00265 #ifdef GLIBMM_VFUNCS_ENABLED
00266 #endif //GLIBMM_VFUNCS_ENABLED
00267
00268
00269 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00270 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00271
00272
00273 };
00274
00275 }
00276
00277
00278
00279 namespace Glib
00280 {
00289 Glib::RefPtr<Clutter::Shader> wrap(ClutterShader* object, bool take_copy = false);
00290 }
00291
00292
00293 #endif
00294