#include <KeosMaterial.h>
Public Member Functions | |
| CMaterial () | |
| Default constructor. | |
| CMaterial (const String &strTexture) | |
| Default constructor. | |
| ~CMaterial () | |
| Destructor. | |
| CTexture * | GetTexture (ushort nLayer=0) |
| Get a texture. | |
| bool | CreateTexture (const String &strTexture, ushort nLayer=0) |
| Create a texture. | |
| bool | CreateTexture (const CImage &Image, ushort nLayer=0) |
| Create a texture. | |
| void | SetDiffuseColor (const CColor &Color) |
| Assign a diffuse color. | |
| CColor | GetDiffuseColor () |
| Get the diffuse color. | |
| bool | HasTexture (ushort nLayer=0) |
| Test if the material has a texture in the specified layer. | |
| String | GetName (void) |
| Get the name of the material. | |
| void | SetName (const String &strName) |
| Set the name of the material. | |
Protected Types | |
| typedef std::vector< CTexture * > | TTextureList |
| List of the textures. | |
Protected Attributes | |
| String | m_strName |
| Name of the material. | |
| TTextureList | m_Textures |
| CColor | m_DiffuseColor |
| Diffuse color. | |
..).
Definition at line 33 of file KeosMaterial.h.
typedef std::vector<CTexture*> Keos::CMaterial::TTextureList [protected] |
| Keos::CMaterial::CMaterial | ( | ) |
Default constructor.
Definition at line 34 of file KeosMaterial.cpp.
References m_DiffuseColor, m_strName, and Keos::CColor::White.
| Keos::CMaterial::CMaterial | ( | const String & | strTexture | ) |
Default constructor.
| strTexture | Path of the texture. |
Definition at line 41 of file KeosMaterial.cpp.
References CreateTexture(), m_DiffuseColor, m_strName, and Keos::CColor::White.
| Keos::CMaterial::~CMaterial | ( | ) |
Get a texture.
| nLayer | Layer of the texture, if there are more than one texture. |
Definition at line 54 of file KeosMaterial.h.
References Assert.
Create a texture.
If there is already a texture (for the specified layer), it will be automatically delete.
| strTexture | Path of the texture. | |
| nLayer | Layer where the texture will be created. |
Definition at line 56 of file KeosMaterial.cpp.
References Keos::CTexture::CreateFromFile(), Keos::CSingleton< T >::Instance(), KEOS_DELETE, Keos::ILogger::Log(), m_Textures, and Keos::PXF_A8R8G8B8.
Referenced by CMaterial(), Keos::CMDLQ1Loader::LoadFromFile(), Keos::CMD2Loader::LoadFromFile(), and Keos::CMD2AnimatedLoader::LoadFromFile().
Create a texture.
If there is already a texture (for the specified layer), it will be automatically delete.
| Image | Image of the texture. | |
| nLayer | Layer where the texture will be created. |
Definition at line 83 of file KeosMaterial.cpp.
References Keos::CTexture::CreateFromImage(), Keos::CImage::GetFormat(), Keos::CSingleton< T >::Instance(), KEOS_DELETE, Keos::ILogger::Log(), and m_Textures.
| void Keos::CMaterial::SetDiffuseColor | ( | const CColor & | Color | ) | [inline] |
| CColor Keos::CMaterial::GetDiffuseColor | ( | void | ) | [inline] |
Get the diffuse color.
Definition at line 85 of file KeosMaterial.h.
Referenced by Keos::CMeshGeom::AssignMaterialColor().
| bool Keos::CMaterial::HasTexture | ( | ushort | nLayer = 0 |
) | [inline] |
Test if the material has a texture in the specified layer.
Definition at line 92 of file KeosMaterial.h.
| String Keos::CMaterial::GetName | ( | void | ) | [inline] |
| void Keos::CMaterial::SetName | ( | const String & | strName | ) | [inline] |
String Keos::CMaterial::m_strName [protected] |
TTextureList Keos::CMaterial::m_Textures [protected] |
CColor Keos::CMaterial::m_DiffuseColor [protected] |
1.5.1-p1