]> git.tdb.fi Git - libs/gl.git/blobdiff - source/effects/sky.h
Support effects and subordinate sequences inside sequence templates
[libs/gl.git] / source / effects / sky.h
index be31b3085625001c9603adb1c28f4232e64862da..0152729a0ec8cf8dbb5ba88c5fc529ad5fd895c2 100644 (file)
@@ -8,8 +8,8 @@
 namespace Msp {
 namespace GL {
 
+class DirectionalLight;
 class Mesh;
-class Light;
 class Program;
 
 /**
@@ -39,9 +39,27 @@ public:
                static Planet earth();
        };
 
+       struct Template: Effect::Template
+       {
+               class Loader: public DataFile::DerivedObjectLoader<Template, Effect::Template::Loader>
+               {
+               private:
+                       static ActionMap shared_actions;
+
+               public:
+                       Loader(Template &, Collection &);
+               private:
+                       virtual void init_actions();
+               };
+
+               DirectionalLight *sun = 0;
+
+               virtual Sky *create(const std::map<std::string, Renderable *> &) const;
+       };
+
 private:
        Planet planet;
-       Light &sun;
+       DirectionalLight &sun;
        RenderTarget transmittance_lookup;
        const Program &transmittance_shprog;
        bool transmittance_lookup_dirty;
@@ -56,7 +74,7 @@ private:
        bool rendered;
 
 public:
-       Sky(Renderable &, Light &);
+       Sky(Renderable &, DirectionalLight &);
 
        void set_planet(const Planet &);
        void set_view_height(float);