#include <string>
#include <vector>
-#include <msp/datafile/loadabletyperegistry.h>
+#include <msp/core/typeregistry.h>
#include <msp/datafile/objectloader.h>
#include "blend.h"
#include "postprocessor.h"
template<typename T>
struct AddPostProc
{
- static void add(PostProcLoader &ldr, const std::string &kw) { ldr.add(kw, &PostProcLoader::postprocessor<T>); }
+ void operator()(const std::string &kw, PostProcLoader &ldr) const { ldr.add(kw, &PostProcLoader::postprocessor<T>); }
};
protected:
};
public:
- class Loader: public DataFile::CollectionObjectLoader<PipelineTemplate>, public PostProcLoader
+ class Loader: public DataFile::CollectionObjectLoader<PipelineTemplate, Resources>, public PostProcLoader
{
public:
- Loader(PipelineTemplate &);
Loader(PipelineTemplate &, Collection &);
- private:
- void init();
virtual void postprocessor_loaded();
void multisample(unsigned);
typedef std::vector<PostProcessor> PostProcessorArray;
private:
- typedef DataFile::LoadableTypeRegistry<PostProcLoader, PostProcLoader::AddPostProc> PostProcessorRegistry;
+ typedef TypeRegistry<PostProcLoader::AddPostProc, PostProcLoader &> PostProcessorRegistry;
+ Resources *resources;
bool hdr;
bool alpha;
unsigned required_multisample;
PipelineTemplate();
~PipelineTemplate();
+ Resources &get_resources() const;
bool get_hdr() const { return hdr; }
bool get_alpha() const { return alpha; }
unsigned get_required_multisample() const { return required_multisample; }