X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fbuilders%2Fsequencetemplate.h;h=5c13aebebc2263677447e93e33ab96de25883cf0;hp=6b943dd1499f962bea05968643a936d01e16a8f9;hb=083a8227715fa32c841fc2b8126e4ab8d2840ba0;hpb=f44366c8785eb7a88755cd71250a8b85289eeed2 diff --git a/source/builders/sequencetemplate.h b/source/builders/sequencetemplate.h index 6b943dd1..5c13aebe 100644 --- a/source/builders/sequencetemplate.h +++ b/source/builders/sequencetemplate.h @@ -7,6 +7,7 @@ #include #include #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 { + 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 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,15 +111,32 @@ public: private: class ClearLoader: public DataFile::ObjectLoader { + 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 + { + 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; @@ -132,6 +164,9 @@ public: float get_clear_depth() const { return clear_depth; } int get_clear_stencil() const { return clear_stencil; } + template + static void register_effect(const std::string &); + template static void register_postprocessor(const std::string &); @@ -140,6 +175,12 @@ private: static TemplateRegistry &get_registry(); }; +template +void SequenceTemplate::register_effect(const std::string &kw) +{ + get_registry().register_type(kw); +} + template void SequenceTemplate::register_postprocessor(const std::string &kw) {