41 lines
1021 B
C++
41 lines
1021 B
C++
#ifndef GUIShaderNodeIO_h__
|
|||
|
|
#define GUIShaderNodeIO_h__
|
||
|
|
|
||
|
|
#include <gui/GUIWindow.h>
|
||
|
|
#include <gui/GUIPlane.h>
|
||
|
|
#include <gui/GUIText.h>
|
||
|
|
#include "GUINodePort.h"
|
||
|
|
#include <shaders/IShaderGraphNodePort.h>
|
||
|
|
|
||
|
|
class GUIShaderNode;
|
||
|
|
class GUIShaderNodeIO : public GUIWindow
|
||
|
|
{
|
||
|
|
friend class GUIShaderNode;
|
||
|
|
public:
|
||
|
|
EVENT2(IOEvent, GUIShaderNodeIO*, GUIShaderNodeIO*);
|
||
|
|
IOEvent Event_Link;
|
||
|
|
|
||
|
|
MouseEvent Event_PortClick;
|
||
|
|
|
||
|
|
GUIShaderNodeIO(GUIShaderNode* _parent);
|
||
|
|
~GUIShaderNodeIO();
|
||
|
|
int id;
|
||
|
|
void SetMode(bool input);
|
||
|
|
void Update(float dt);
|
||
|
|
void RenderSelf();
|
||
|
|
void SetBackColor(const Vec4f& color);
|
||
|
|
void SetCaption(const String& _caption);
|
||
|
|
bool IsInput(){return mode_input;}
|
||
|
|
Vec2i GetAttachPoint();
|
||
|
|
GUIShaderNode* Owner;
|
||
|
|
IShaderGraphNodePort* GraphicsPort;
|
||
|
|
private:
|
||
|
|
void AcceptLink(GUINodePort* me, GUINodePort* other);
|
||
|
|
bool can_drag;
|
||
|
|
void OnArrowPress(GUIWindow* w, int arg);
|
||
|
|
void OnArrowClick(GUIWindow* w, int arg);
|
||
|
|
GUINodePort* arrow;
|
||
|
|
GUIText* caption;
|
||
|
|
bool mode_input;
|
||
|
|
};
|
||
|
|
#endif // GUIShaderNodeIO_h__
|