00001 #ifndef GLT_MATERIAL_H
00002 #define GLT_MATERIAL_H
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00039 #include <glt/gl.h>
00040 #include <glt/color.h>
00041 
00042 #include <iosfwd>
00043 
00051 class GltMaterial
00052 {
00053 public:
00054     
00056     GltMaterial(const GLenum face = GL_FRONT_AND_BACK,const bool getIt = false);
00057 
00059     GltMaterial
00060     (
00061         const GltColor &ambient,
00062         const GltColor &diffuse,
00063         const GltColor &specular,
00064         const GltColor &emission,
00065         const GLfloat   shininess,
00066         const GLenum face  = GL_FRONT_AND_BACK
00067     );
00068 
00070     GltMaterial(const std::string &name,const GLenum face  = GL_FRONT_AND_BACK);
00071 
00073     ~GltMaterial();
00074 
00075     
00076 
00078     void get();
00080     void set() const;
00081 
00082     
00083 
00084                                         
00085     GLenum   &face();
00086                                         
00087     GltColor &ambient();
00088                                         
00089     GltColor &diffuse();
00090                                         
00091     GltColor &specular();
00092                                         
00093     GltColor &emission();
00094                                         
00095     GLfloat  &shininess();
00096                                         
00097     GLint    *colorIndex();
00098 
00099                                         
00100     const GLenum   &face()       const;
00101                                         
00102     const GltColor &ambient()    const;
00103                                         
00104     const GltColor &diffuse()    const;
00105                                         
00106     const GltColor &specular()   const;
00107                                         
00108     const GltColor &emission()   const;
00109                                         
00110     const GLfloat  &shininess()  const;
00111                                         
00112     const GLint    *colorIndex() const;
00113 
00114 private:
00115 
00116     GLenum  _face;
00117 
00118     GltColor _ambient;
00119     GltColor _diffuse;
00120     GltColor _specular;
00121     GltColor _emission;
00122     GLfloat _shininess;
00123 
00124     GLint   _colorIndex[4];
00125 
00126     
00127 
00128     static const int          _matSize;
00129     static const char        *_matName [];
00130     static const GltMaterial *_matValue[];
00131 };
00132 
00133 
00134 
00135 extern const GltMaterial blackPlasticMaterial;
00136 extern const GltMaterial blackRubberMaterial;
00137 extern const GltMaterial brassMaterial;
00138 extern const GltMaterial bronzeMaterial;
00139 extern const GltMaterial chromeMaterial;
00140 extern const GltMaterial copperMaterial;
00141 extern const GltMaterial emeraldMaterial;
00142 extern const GltMaterial goldMaterial;
00143 extern const GltMaterial jadeMaterial;
00144 extern const GltMaterial obsidianMaterial;
00145 extern const GltMaterial pearlMaterial;
00146 extern const GltMaterial pewterMaterial;
00147 extern const GltMaterial polishedBronzeMaterial;
00148 extern const GltMaterial polishedCopperMaterial;
00149 extern const GltMaterial polishedGoldMaterial;
00150 extern const GltMaterial polishedSilverMaterial;
00151 extern const GltMaterial rubyMaterial;
00152 extern const GltMaterial silverMaterial;
00153 extern const GltMaterial turquoiseMaterial;
00154 extern const GltMaterial whitePlasticMaterial;
00155 
00156 #endif