/////////////////////////////////////////////////////////////
// CINEMA 4D SDK                                           //
/////////////////////////////////////////////////////////////
// (c) MAXON Computer GmbH, all rights reserved            //
/////////////////////////////////////////////////////////////

#ifndef __C4DSHADERDATA_H
#define __C4DSHADERDATA_H

#include "ge_prepass.h"
#include "c4d_nodedata.h"
#include "operatingsystem.h"

class  BaseShader;
class  BaseObject;
class  BaseDraw;
class  BaseDrawHelp;
class  BaseDocument;
class  BaseBitmap;
class  String;
class  BaseTag;
class  BaseThread;
struct InitRenderStruct;
struct VolumeData;
struct ChannelData;

class ShaderData : public NodeData
{
	public:
		////inherited from NodeData////
		//virtual Bool Init(GeListNode *node);
		//virtual void Free(GeListNode *node);
		//virtual Bool Read(GeListNode *node, HyperFile *hf, LONG level);
		//virtual Bool Write(GeListNode *node, HyperFile *hf);
		//virtual Bool Message(GeListNode *node, LONG type, void *data);
		//virtual Bool CopyTo(NodeData *dest, GeListNode *snode, GeListNode *dnode, COPYFLAGS flags, AliasTrans *trn);
		//virtual void GetBubbleHelp(GeListNode *node, String &str);
		//virtual BaseDocument* GetDocument(GeListNode *node);
		//virtual LONG GetBranchInfo(GeListNode *node, BranchInfo *info, LONG max, GETBRANCHINFO flags);
		//virtual Bool GetDDescription(GeListNode *node, Description *description, DESCFLAGS_DESC &flags);
		//virtual Bool GetDParameter(GeListNode *node, const DescID &id,GeData &t_data,DESCFLAGS_GET &flags);
		//virtual Bool GetDEnabling(GeListNode *node, const DescID &id,const GeData &t_data,DESCFLAGS_ENABLE flags,const BaseContainer *itemdesc);
		//virtual Bool SetDParameter(GeListNode *node, const DescID &id,const GeData &t_data,DESCFLAGS_SET &flags);
		//static NodeData *Alloc(void) { return gNew MyNodeData; }
		////inherited from NodeData////

		// for use with glProgramFactory::GetDescriptionData
		//static void* AllocCgDescription();
		//static void FreeCgDescription(void* pData);
		//static Bool ReadCgDescription(GlReadDescriptionData* pFile, void* pData);
		//static Bool WriteCgDescription(GlWriteDescriptionData* pFile, const void* pData);
		//

		virtual	Bool Draw(BaseShader *sh, BaseObject *op, BaseTag *tag, BaseDraw *bd, BaseDrawHelp *bh);

		virtual	SHADERINFO GetRenderInfo(BaseShader *sh);

		virtual	INITRENDERRESULT InitRender(BaseShader *sh, const InitRenderStruct &irs);
		virtual	void FreeRender(BaseShader *sh);

		virtual	Vector Output(BaseShader *sh, ChannelData *cd);
		virtual GL_MESSAGE GlMessage(BaseShader *sh, LONG type, void *msgdata);
		virtual LONG InitGLImage(BaseShader *sh, BaseDocument* doc, BaseThread* th, BaseBitmap *bmp, Bool alpha, LONG doccolorspace, Bool linearworkflow);
		virtual void DestroyGLImage(BaseShader *sh, BaseDocument* doc);
		virtual void InvalidateGLImage(BaseShader *sh, BaseDocument* doc);
		virtual Bool GetGLImageSize(BaseShader *sh, BaseDocument* doc, LONG s, Bool noScale, LONG &w, LONG &h);
};

Bool RegisterShaderPlugin(LONG id, const String &str, LONG info, DataAllocator *g, const String &description, LONG disklevel, void *emulation=NULL);

#endif
