Files
LifeProject/LifeGraphics/shaders/IShaderGraph.h
T

40 lines
1.1 KiB
C++
Raw Normal View History

2025-05-13 02:46:21 +03:00
#ifndef IShaderGraph_h__
#define IShaderGraph_h__
#include "shaders/IShaderGraphNodeFactory.h"
#include "delegate/Delegate.h"
#include <vector>
#include <IMemoryStream.h>
namespace LifeGraphics
{
class IShaderGraph
{
public:
EVENT1(GraphEvent, IShaderGraphNode*);
GraphEvent Event_AddNode;
IShaderGraph(IShaderGraphNodeFactory* factory);
~IShaderGraph();
IShaderGraphNode* AddNode(const String& name);
bool DeleteNode(int id);
void Serialize(LifeCore::IMemoryStream* stm);
bool Deserialize(LifeCore::IMemoryStream* stm);
void SerializeXML(LifeCore::IMemoryStream* stm);
bool DeserializeXML(LifeCore::IMemoryStream* stm);
IShaderGraphNode* GetNodeByID(int id);
IShaderGraphNode* GetNodeByArrayID(int id);
size_t GetNodeCount();
void Clear();
private:
int texture_slots[16];
int last_id;
int GrabTextureSlot();
int GetID(){return last_id++;}
IShaderGraphNodeFactory* pFactory;
typedef std::vector<IShaderGraphNode*> NodeCollection;
typedef std::vector<IShaderGraphNode*>::iterator NodeCollectionIt;
NodeCollection Nodes;
};
}
#endif // IShaderGraph_h__