00001 #ifndef MATERIAL_H 00002 #define MATERIAL_H 00003 00004 #pragma once 00005 #include "XMLResource.h" 00006 #include "Color.h" 00007 00009 00013 class CMaterial : public CXMLResource 00014 { 00015 protected: 00016 00017 CREATOR(CMaterialManager); 00018 00019 CMaterial(); 00020 virtual ~CMaterial(); 00021 00022 public: 00028 virtual int LoadXML(TiXmlNode *pDataNode, CString strFilename); 00034 virtual int SaveXML(TiXmlNode *pDataNode, CString strFilename); 00039 virtual void Bind() = 0; 00044 tRGBA& GetAmbient(); 00049 tRGBA& GetDiffuse(); 00054 tRGBA& GetEmissive(); 00059 tRGBA& GetSpecular(); 00064 float& GetShininess(); 00065 00070 void SetAmbient(tRGBA ambient); 00075 void SetDiffuse(tRGBA diffuse); 00080 void SetEmissive(tRGBA emissive); 00085 void SetSpecular(tRGBA specular); 00090 void SetShininess(float fShininess); 00095 virtual void Destroy(); 00100 virtual bool IsOfType(eEntityType eType); 00101 00102 protected: 00103 00104 tRGBA m_Ambient, 00105 m_Diffuse, 00106 m_Emissive, 00107 m_Specular; 00109 float m_fShininess; 00110 }; 00111 00112 #endif