19 lines
473 B
C++
19 lines
473 B
C++
#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;
|
|
}
|
|
} |