
#ifndef __SHADER_H__
#define __SHADER_H__

//--------------------
// 組み込みファイル名
//--------------------
#include <d3dx9.h>

//-
//
//-
class CShader{
private:
	LPDIRECT3DVERTEXSHADER9	m_pVertexShader;
	LPDIRECT3DPIXELSHADER9	m_pPixelShader;
	LPD3DXCONSTANTTABLE		m_pVertexConstTbl;
	LPD3DXCONSTANTTABLE		m_pPixelConstTbl;

protected:
	CShader();
	virtual	~CShader();

public:
	static CShader *allocate(void);
	static void    dispose(CShader *&shd);

private:
	int		compileVertexShader(const char *pFileName, const char *pProfile);
	int		compilePixelShader(const char *pFileName, const char *pProfile);

public:
	int		buildShader(LPDIRECT3DDEVICE9 pD3DDev, const char *pVertexFileName, const char *pVertexProfile, const char *pPixelFileName, const char *pPixelProfile);

public:
	LPDIRECT3DVERTEXSHADER9	getVertexShader(void) const {return(m_pVertexShader);}
	LPDIRECT3DPIXELSHADER9	getPixelShader(void) const {return(m_pPixelShader);}
	LPD3DXCONSTANTTABLE		getVertexConstantTable(void) const {return(m_pVertexConstTbl);}
	LPD3DXCONSTANTTABLE		getPixelConstantTable(void) const {return(m_pPixelConstTbl);}
};

#endif	// ifndef __SHADER_H__
