- Cal3D 0.9 API Reference -

corematerial.h

00001 //****************************************************************************//
00002 // corematerial.h                                                             //
00003 // Copyright (C) 2001, 2002 Bruno 'Beosil' Heidelberger                       //
00004 //****************************************************************************//
00005 // This library is free software; you can redistribute it and/or modify it    //
00006 // under the terms of the GNU Lesser General Public License as published by   //
00007 // the Free Software Foundation; either version 2.1 of the License, or (at    //
00008 // your option) any later version.                                            //
00009 //****************************************************************************//
00010 
00011 #ifndef CAL_COREMATERIAL_H
00012 #define CAL_COREMATERIAL_H
00013 
00014 
00015 #include "cal3d/global.h"
00016 
00017 
00018 class CAL3D_API CalCoreMaterial
00019 {
00020 public:
00021   struct Color
00022   {
00023     unsigned char red;
00024     unsigned char green;
00025     unsigned char blue;
00026     unsigned char alpha;
00027   };
00028 
00029   struct Map
00030   {
00031     std::string strFilename;
00032     Cal::UserData userData;
00033   };
00034 
00035 public:
00036   CalCoreMaterial();
00037   ~CalCoreMaterial() { }
00038 
00039   Color& getAmbientColor();
00040   Color& getDiffuseColor();
00041   int getMapCount();
00042   const std::string& getMapFilename(int mapId);
00043   Cal::UserData getMapUserData(int mapId);
00044   float getShininess();
00045   Color& getSpecularColor();
00046   Cal::UserData getUserData();
00047   std::vector<Map>& getVectorMap();
00048   bool reserve(int mapCount);
00049   void setAmbientColor(const Color& ambientColor);
00050   void setDiffuseColor(const Color& diffuseColor);
00051   bool setMap(int mapId, const Map& map);
00052   bool setMapUserData(int mapId, Cal::UserData userData);
00053   void setShininess(float shininess);
00054   void setSpecularColor(const Color& specularColor);
00055   void setFilename(const std::string& filename);
00056   const std::string& getFilename(void);
00057   void setName(const std::string& name);
00058   const std::string& getName(void);
00059   void setUserData(Cal::UserData userData);
00060   void incRef();
00061   bool decRef();  
00062 
00063 private:
00064   Color m_ambientColor;
00065   Color m_diffuseColor;
00066   Color m_specularColor;
00067   float m_shininess;
00068   std::vector<Map> m_vectorMap;
00069   Cal::UserData m_userData;
00070   std::string m_name;
00071   std::string m_filename;
00072 
00073   int m_referenceCount;
00074 };
00075 
00076 #endif
00077 
00078 //****************************************************************************//

Generated at Sun Jan 29 14:29:16 2006 by The Cal3D Team with doxygen 1.4.6 © 1997-2001 Dimitri van Heesch