]> git.tdb.fi Git - libs/gl.git/blobdiff - source/builders/sequencetemplate.h
Check the flat qualifier from the correct member
[libs/gl.git] / source / builders / sequencetemplate.h
index 6b943dd1499f962bea05968643a936d01e16a8f9..34e4924befc521902d5f5827af46b88b2c032946 100644 (file)
@@ -7,6 +7,7 @@
 #include <msp/datafile/dynamicobjectloader.h>
 #include <msp/datafile/objectloader.h>
 #include "depthtest.h"
+#include "effect.h"
 #include "postprocessor.h"
 #include "resources.h"
 #include "stenciltest.h"
@@ -38,23 +39,32 @@ private:
 public:
        class Loader: public DataFile::CollectionObjectLoader<SequenceTemplate>
        {
+       private:
+               static ActionMap shared_actions;
+
        public:
                Loader(SequenceTemplate &, Collection &);
-
        private:
+               virtual void init_actions();
+
                void clear();
+               void effect(const std::string &);
                void multisample(unsigned);
                void multisample_range(unsigned, unsigned);
                void postprocessor();
                void postprocessor_with_slot(const std::string &);
                void renderable(const std::string &);
                void renderable_with_default(const std::string &, const std::string &);
+               void sequence(const std::string &, const std::string &);
                void step(const std::string &, const std::string &);
        };
 
        struct Renderable
        {
+               Effect::Template *effect_template = 0;
                GL::Renderable *renderable = 0;
+               SequenceTemplate *sequence_template = 0;
+               std::map<std::string, std::string> sequence_renderables;
                std::string slot_name;
        };
 
@@ -65,9 +75,14 @@ public:
                private:
                        std::string inline_base_name;
 
+                       static ActionMap shared_actions;
+
                public:
                        Loader(Step &, Collection &);
+               private:
+                       virtual void init_actions();
 
+               public:
                        void set_inline_base_name(const std::string &);
 
                private:
@@ -96,17 +111,33 @@ public:
 private:
        class ClearLoader: public DataFile::ObjectLoader<SequenceTemplate>
        {
+       private:
+               static ActionMap shared_actions;
+
        public:
                ClearLoader(SequenceTemplate &);
-
        private:
+               virtual void init_actions();
+
                void color(float, float, float, float);
                void depth(float);
                void stencil(int);
        };
 
+       class SequenceLoader: public DataFile::ObjectLoader<Renderable>
+       {
+       private:
+               static ActionMap shared_actions;
+
+       public:
+               SequenceLoader(Renderable &);
+       private:
+               virtual void init_actions();
+
+               void renderable(const std::string &, const std::string &);
+       };
+
        bool hdr = false;
-       bool alpha = false;
        unsigned required_multisample = 0;
        unsigned max_multisample = 0;
        std::vector<Renderable> renderables;
@@ -121,7 +152,6 @@ public:
        ~SequenceTemplate();
 
        bool get_hdr() const { return hdr; }
-       bool get_alpha() const { return alpha; }
        unsigned get_required_multisample() const { return required_multisample; }
        unsigned get_maximum_multisample() const { return max_multisample; }
        const std::vector<Renderable> &get_renderables() const { return renderables; }
@@ -132,6 +162,9 @@ public:
        float get_clear_depth() const { return clear_depth; }
        int get_clear_stencil() const { return clear_stencil; }
 
+       template<typename T>
+       static void register_effect(const std::string &);
+
        template<typename T>
        static void register_postprocessor(const std::string &);
 
@@ -140,6 +173,12 @@ private:
        static TemplateRegistry<T> &get_registry();
 };
 
+template<typename T>
+void SequenceTemplate::register_effect(const std::string &kw)
+{
+       get_registry<Effect>().register_type<typename T::Template>(kw);
+}
+
 template<typename T>
 void SequenceTemplate::register_postprocessor(const std::string &kw)
 {