Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members

glmaterial.h

00001 /***************************************************************************
00002                           glmaterial.h  -  description
00003                              -------------------
00004     begin                : Fri Apr 25 2003
00005     copyright            : (C) 2003 by 
00006     email                : jgasseli@localhost.localdomain
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU Lesser General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef GLMATERIAL_H
00019 #define GLMATERIAL_H
00020 
00021 #include <GL/gl.h>
00022 #include <fstream>
00023 #include "glscene.h"
00024 
00031 namespace GLScene
00032 {  
00033 
00034 class GLMaterial: public GLRenderState
00035 {
00036 //   std::string name;
00037 protected:
00038    GLfloat specular[4];
00039    GLfloat emission[4];
00040    GLfloat diffuse[4];
00041    GLfloat ambient[4];
00042    GLfloat shininess;
00043    GLenum face;
00044    
00045 public:
00046    SML_TAG(material);
00047 //   static char startTag[20];
00048 //   static char endTag[20];
00049 
00050 //   TYPE_NAME(Material);
00051 
00052    GLMaterial();
00053    virtual ~GLMaterial();
00054    void setSpecular(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
00055    void setEmission(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
00056    void setDiffuse(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
00057    void setAmbient(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
00058    void setShininess(GLfloat s);
00059    void setFace(GLenum f);
00060 
00061    inline const GLfloat* getSpecular() { return specular; }
00062    inline const GLfloat* getDiffuse() { return diffuse; }
00063    inline const GLfloat* getEmission() { return emission; }
00064    inline const GLfloat* getAmbient() { return ambient; }
00065    inline GLfloat getShininess() { return shininess; }
00066    inline GLenum getFace() { return face; }
00067    
00068    virtual void use();
00069 
00070    virtual void render();
00071 
00072 
00073 //   void loadFromStream(std::istream&);
00074 //   void saveToStream(std::ostream&);
00075 
00076 //   virtual const char* getName(){ return name.c_str(); }
00077 //   virtual void setName(const char* n){ name = n; }
00078 };
00079 
00080 };
00081 
00082 #endif

Generated on Wed Feb 4 23:11:33 2004 by doxygen 1.3.3