00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KEOS_MATERIAL_H
00022 #define KEOS_MATERIAL_H
00023
00024 #include "KeosPrerequisites.h"
00025 #include "KeosTexture.h"
00026 #include "KeosColor.h"
00027
00028 namespace Keos
00029 {
00030
00033 class KEOS_EXPORT CMaterial
00034 {
00035 public :
00036
00039 CMaterial();
00040
00044 CMaterial(const String& strTexture);
00045
00048 ~CMaterial();
00049
00054 CTexture* GetTexture(ushort nLayer = 0)
00055 {
00056 Assert (nLayer < m_Textures.size());
00057 return m_Textures[nLayer];
00058 }
00059
00066 bool CreateTexture(const String& strTexture, ushort nLayer = 0);
00067
00074 bool CreateTexture(const CImage& Image, ushort nLayer = 0);
00075
00078 void SetDiffuseColor(const CColor& Color)
00079 {
00080 m_DiffuseColor = Color;
00081 }
00082
00085 CColor GetDiffuseColor()
00086 {
00087 return m_DiffuseColor;
00088 }
00089
00092 bool HasTexture(ushort nLayer = 0)
00093 {
00094 return (m_Textures.size() > nLayer);
00095 }
00096
00099 String GetName(void)
00100 {
00101 return m_strName;
00102 }
00103
00106 void SetName(const String& strName)
00107 {
00108 m_strName = strName;
00109 }
00110
00111 protected :
00112
00114 String m_strName;
00115
00117 typedef std::vector<CTexture*> TTextureList;
00118 TTextureList m_Textures;
00119
00121 CColor m_DiffuseColor;
00122 };
00123
00125 typedef CSmartPtr<CMaterial, CRefCount> TMaterialPtr;
00126
00127 }
00128
00129 #endif // KEOS_MATERIAL_H