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
00057
00058 public:
00059 CalCoreMaterial();
00060 virtual ~CalCoreMaterial();
00061
00062
00063 public:
00064 bool create();
00065 void destroy();
00066 Color& getAmbientColor();
00067 Color& getDiffuseColor();
00068 int getMapCount();
00069 const std::string& getMapFilename(int mapId);
00070 Cal::UserData getMapUserData(int mapId);
00071 float getShininess();
00072 Color& getSpecularColor();
00073 Cal::UserData getUserData();
00074 std::vector<Map>& getVectorMap();
00075 bool reserve(int mapCount);
00076 void setAmbientColor(const Color& ambientColor);
00077 void setDiffuseColor(const Color& diffuseColor);
00078 bool setMap(int mapId, const Map& map);
00079 bool setMapUserData(int mapId, Cal::UserData userData);
00080 void setShininess(float shininess);
00081 void setSpecularColor(const Color& specularColor);
00082 void setUserData(Cal::UserData userData);
00083 };
00084
00085 #endif
00086
00087