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

Generated at Thu Dec 2 19:29:05 2004 by The Cal3D Team with doxygen 1.3.9.1 © 1997-2001 Dimitri van Heesch