#pragma once

#include "DLLInterface.h"
#include "ShaderEffect.h"

class EffectCompiler;

class DXFUNCTIONS_API CompiledEffect : public ShaderEffect
{
	friend EffectCompiler;

	D3DXMACRO*		m_pDefines;
	EffectCompiler* m_Compiler;

protected:
	friend EffectCompiler;
	friend ListElement<CompiledEffect>;
	friend LList<CompiledEffect>;

	CompiledEffect(EffectCompiler* const compiler, D3DXMACRO* pDefines);
	~CompiledEffect(void);

	D3DXMACRO* GetDefines(void) {return m_pDefines;}

public:
	//set values for compiler, compile and restore old values
	void Compile(bool debug = false);

	EffectCompiler* GetCompiler(void) const { return m_Compiler; }
};