Original Post
below is my Material class, but I found IDirect3DTexture9 * m_texture is actually unused . according to refactor it should be remove it out. but texture should be together with material. remove it or not? reason?
class Material
{
public:
/** Constructor - use resource manager's create method rather than this.
*/
Material();
~Material();
Material& operator=( const Material& rhs );
bool isTransparent(void) const;
// -------------------------------------------------------------------------------
D3DCOLORVALUE & ambient();
const D3DCOLORVALUE & diffuse();
const D3DCOLORVALUE & specular();
const D3DCOLORVALUE & emissive();
void power();
void setAmbient(const D3DXCOLOR& ambient);
void setDiffuse(const D3DXCOLOR& diffuse);
void setSpecular(const D3DXCOLOR& specular);
void setEmissive(const D3DXCOLOR& selfIllum);
void addEmissive(const D3DXCOLOR& selfIllum);
void addDiffuse(const D3DXCOLOR& diffuse);
void addAmbient(const D3DXCOLOR& ambient);
void setPower(float val);
void addBright();
void subBright();
D3DMATERIAL9 &material9();
void setMaterial9( D3DMATERIAL9* );
IDirect3DTexture9 * texture() const;
void setTexture(IDirect3DTexture9 * t);
void setLightingEnabled(bool enabled);
protected:
std::string m_name;
bool m_transparent;
bool m_lightEnabled;
D3DMATERIAL9 m_dxMaterial;
IDirect3DTexture9 *m_texture;
/** Internal method which sets the material up from the default settings.
*/
void init(void);
/** Overridden from Resource.
*/
};