*
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
#include "shaders/IShaderGraphNodeFactory.h"
|
||||
|
||||
namespace LifeGraphics
|
||||
{
|
||||
void IShaderGraphNodeFactory::RegisterNode(const String& name, NodeFactoryFunc func)
|
||||
{
|
||||
if(FactoryFuncs.find(name) != FactoryFuncs.end())
|
||||
return;
|
||||
FactoryFuncs[name] = func;
|
||||
}
|
||||
IShaderGraphNode* IShaderGraphNodeFactory::Build(const String& name)
|
||||
{
|
||||
if(FactoryFuncs.find(name) == FactoryFuncs.end())
|
||||
return 0;
|
||||
IShaderGraphNode* n = FactoryFuncs[name]();
|
||||
n->Name = name;
|
||||
return n;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user