- Cal3D 0.9 API Reference -

Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

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 // Includes                                                                   //
00016 //****************************************************************************//
00017 
00018 #include "cal3d/global.h"
00019 
00020 //****************************************************************************//
00021 // Class declaration                                                          //
00022 //****************************************************************************//
00023 
00024  /*****************************************************************************/
00028 class CAL3D_API CalCoreMaterial
00029 {
00030 // misc
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 // member variables
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 // constructors/destructor
00062 public:
00063   CalCoreMaterial();
00064   virtual ~CalCoreMaterial();
00065 
00066 // member functions
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 //****************************************************************************//

Generated at Fri Nov 19 03:49:19 2004 by The Cal3D Team with doxygen 1.3.9.1 © 1997-2001 Dimitri van Heesch