25 lines
686 B
C++
25 lines
686 B
C++
#ifndef IShaderGraphNodeFactory_h__
|
|||
|
|
#define IShaderGraphNodeFactory_h__
|
||
|
|
|
||
|
|
#include "shaders/IShaderGraphNode.h"
|
||
|
|
#include <hash_map>
|
||
|
|
#include <Singleton.h>
|
||
|
|
|
||
|
|
namespace LifeGraphics
|
||
|
|
{
|
||
|
|
class IShaderGraphNodeFactory;
|
||
|
|
class IShaderGraphNodeFactory : public Singleton<IShaderGraphNodeFactory>
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
friend class Singleton<IShaderGraphNodeFactory>;
|
||
|
|
typedef IShaderGraphNode* (*NodeFactoryFunc)();
|
||
|
|
void RegisterNode(const String& name, NodeFactoryFunc func);
|
||
|
|
IShaderGraphNode* Build(const String& name);
|
||
|
|
private:
|
||
|
|
IShaderGraphNodeFactory(){}
|
||
|
|
typedef std::hash_map<String, NodeFactoryFunc> FactoryArray;
|
||
|
|
FactoryArray FactoryFuncs;
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
#endif // IShaderGraphNodeFactory_h__
|