Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

glt/material.h

Go to the documentation of this file.
00001 #ifndef GLT_MATERIAL_H
00002 #define GLT_MATERIAL_H
00003 
00004 /*
00005 
00006   GLT OpenGL C++ Toolkit      
00007   Copyright (C) 2000-2002 Nigel Stewart
00008   Email: nigels.com@gmail.com   WWW: http://www.nigels.com/glt/
00009       
00010   This library is free software; you can redistribute it and/or
00011   modify it under the terms of the GNU Lesser General Public
00012   License as published by the Free Software Foundation; either
00013   version 2.1 of the License, or (at your option) any later version.
00014 
00015   This library is distributed in the hope that it will be useful,
00016   but WITHOUT ANY WARRANTY; without even the implied warranty of
00017   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018   Lesser General Public License for more details.
00019 
00020   You should have received a copy of the GNU Lesser General Public
00021   License along with this library; if not, write to the Free Software
00022   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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                                         // Front and/or back face
00085     GLenum   &face();
00086                                         // Ambient color
00087     GltColor &ambient();
00088                                         // Diffuse color
00089     GltColor &diffuse();
00090                                         // Specular color
00091     GltColor &specular();
00092                                         // Emissive color
00093     GltColor &emission();
00094                                         // Shininess coefficient
00095     GLfloat  &shininess();
00096                                         // Color Index
00097     GLint    *colorIndex();
00098 
00099                                         // Front and/or back face
00100     const GLenum   &face()       const;
00101                                         // Ambient color
00102     const GltColor &ambient()    const;
00103                                         // Diffuse color
00104     const GltColor &diffuse()    const;
00105                                         // Specular color
00106     const GltColor &specular()   const;
00107                                         // Emissive color
00108     const GltColor &emission()   const;
00109                                         // Shininess coefficient
00110     const GLfloat  &shininess()  const;
00111                                         // Color Index
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

Generated on Tue Nov 5 11:11:03 2002 for GLT by doxygen1.2.18