mercator  0.4.0
A terrain generation library for the Worldforge system.
ShaderFactory_impl.h
1 // This file may be redistributed and modified only under the terms of
2 // the GNU General Public License (See COPYING for details).
3 // Copyright (C) 2005 Alistair Riddoch
4 
5 #ifndef MERCATOR_SHADER_FACTORY_IMPL_H
6 #define MERCATOR_SHADER_FACTORY_IMPL_H
7 
8 #include "ShaderFactory.h"
9 
10 namespace Mercator {
11 
12 template <class T>
13 ShaderFactory<T>::ShaderFactory() = default;
14 
15 template <class T>
16 ShaderFactory<T>::~ShaderFactory() = default;
17 
18 template <class T>
19 std::unique_ptr<Shader> ShaderFactory<T>::newShader(const Shader::Parameters & params) const
20 {
21  return std::make_unique<T>(params);
22 }
23 
24 } // namespace Mercator
25 
26 #endif // MERCATOR_SHADER_FACTORY_IMPL_H
std::unique_ptr< Shader > newShader(const Shader::Parameters &) const override
Create a new Shader instance.
std::map< std::string, float > Parameters
STL map of parameter values for a shader constructor.
Definition: Shader.h:59