5 #include "ShaderFactory_impl.h" 7 #include "DepthShader.h" 8 #include "FillShader.h" 9 #include "GrassShader.h" 10 #include "ThresholdShader.h" 16 ShaderKit::ShaderKit() =
default;
18 ShaderKit::~ShaderKit() =
default;
20 ShaderFactories::ShaderFactories()
22 m_factories.emplace(
"grass", std::make_unique<ShaderFactory<GrassShader>>());
23 m_factories.emplace(
"depth", std::make_unique<ShaderFactory<DepthShader>>());
24 m_factories.emplace(
"fill", std::make_unique<ShaderFactory<FillShader>>());
25 m_factories.emplace(
"high", std::make_unique<ShaderFactory<HighShader>>());
26 m_factories.emplace(
"low", std::make_unique<ShaderFactory<LowShader>>());
27 m_factories.emplace(
"band", std::make_unique<ShaderFactory<BandShader>>());
30 ShaderFactories::~ShaderFactories() =
default;
41 auto I = m_factories.find(type);
42 if (I == m_factories.end()) {
46 return I->second->newShader(params);
std::map< std::string, float > Parameters
STL map of parameter values for a shader constructor.
std::unique_ptr< Shader > newShader(const std::string &type, const Shader::Parameters &) const
Create a shader of the specified type.