X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpipelinetemplate.h;fp=source%2Fpipelinetemplate.h;h=56c4da19a0e9efb6eb28b9b4519195a3d0779933;hb=18240e2bb031551e9c72a55c7d974904d209760a;hp=0000000000000000000000000000000000000000;hpb=e6bd08e977f3138bfcfa3a1b6cc45201c383e016;p=libs%2Fgl.git diff --git a/source/pipelinetemplate.h b/source/pipelinetemplate.h new file mode 100644 index 00000000..56c4da19 --- /dev/null +++ b/source/pipelinetemplate.h @@ -0,0 +1,89 @@ +#ifndef PIPELINETEMPLATE_H_ +#define PIPELINETEMPLATE_H_ + +#include +#include +#include +#include "blend.h" +#include "postprocessor.h" +#include "predicate.h" + +namespace Msp { +namespace GL { + +class DepthTest; +class Lighting; + +class PipelineTemplate +{ +public: + class Loader: public DataFile::CollectionObjectLoader + { + public: + Loader(PipelineTemplate &); + Loader(PipelineTemplate &, Collection &); + private: + void init(); + + void multisample(unsigned); + void multisample_range(unsigned, unsigned); + void pass(const std::string &, const std::string &); + + template + void postprocessor(); + }; + + struct Pass + { + class Loader: public DataFile::CollectionObjectLoader + { + public: + Loader(Pass &); + Loader(Pass &, Collection &); + private: + void init(); + + void blend(BlendFactor, BlendFactor); + void blend_predefined(const std::string &); + void depth_test(Predicate); + void depth_test_predefined(const std::string &); + void lighting(const std::string &); + void lighting_inline(); + // TODO requires support for scenes in Resources + //void scene(const std::string &); + }; + + std::string tag; + RefPtr lighting; + RefPtr depth_test; + RefPtr blend; + std::string renderable_name; + //Renderable *default_renderable; + + ~Pass(); + }; + + typedef std::vector PassArray; + typedef std::vector PostProcessorArray; + +private: + bool hdr; + unsigned required_multisample; + unsigned max_multisample; + PassArray passes; + PostProcessorArray postprocessors; + +public: + PipelineTemplate(); + + bool get_hdr() const { return hdr; } + unsigned get_required_multisample() const { return required_multisample; } + unsigned get_maximum_multisample() const { return max_multisample; } + const PassArray &get_passes() const { return passes; } + const PostProcessorArray &get_postprocessors() const { return postprocessors; } +}; + +} // namespace GL +} // namespace Msp + +#endif