00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef CAL_COREMATERIAL_H
00012 #define CAL_COREMATERIAL_H
00013
00014
00015
00016
00017
00018 #include "cal3d/global.h"
00019
00020
00021
00022
00023
00024
00028 class CAL3D_API CalCoreMaterial
00029 {
00030
00031 public:
00033 typedef struct
00034 {
00035 unsigned char red;
00036 unsigned char green;
00037 unsigned char blue;
00038 unsigned char alpha;
00039 } Color;
00040
00042 typedef struct
00043 {
00044 std::string strFilename;
00045 Cal::UserData userData;
00046 } Map;
00047
00048
00049 protected:
00050 Color m_ambientColor;
00051 Color m_diffuseColor;
00052 Color m_specularColor;
00053 float m_shininess;
00054 std::vector<Map> m_vectorMap;
00055 Cal::UserData m_userData;
00056 std::string m_name;
00057 std::string m_filename;
00058
00059 int m_referenceCount;
00060
00061
00062 public:
00063 CalCoreMaterial();
00064 virtual ~CalCoreMaterial();
00065
00066
00067 public:
00068 bool create();
00069 void destroy();
00070 Color& getAmbientColor();
00071 Color& getDiffuseColor();
00072 int getMapCount();
00073 const std::string& getMapFilename(int mapId);
00074 Cal::UserData getMapUserData(int mapId);
00075 float getShininess();
00076 Color& getSpecularColor();
00077 Cal::UserData getUserData();
00078 std::vector<Map>& getVectorMap();
00079 bool reserve(int mapCount);
00080 void setAmbientColor(const Color& ambientColor);
00081 void setDiffuseColor(const Color& diffuseColor);
00082 bool setMap(int mapId, const Map& map);
00083 bool setMapUserData(int mapId, Cal::UserData userData);
00084 void setShininess(float shininess);
00085 void setSpecularColor(const Color& specularColor);
00086 void setFilename(const std::string& filename);
00087 const std::string& getFilename(void);
00088 void setName(const std::string& name);
00089 const std::string& getName(void);
00090 void setUserData(Cal::UserData userData);
00091 void incRef();
00092 bool decRef();
00093 };
00094
00095 #endif
00096
00097