[2842] | 1 | /*! |
---|
| 2 | \file material.h |
---|
| 3 | \brief Contains the Material Class that handles Material for 3D-Objects. |
---|
| 4 | */ |
---|
| 5 | |
---|
[2776] | 6 | #ifndef _MATERIAL_H |
---|
| 7 | #define _MATERIAL_H |
---|
[2804] | 8 | |
---|
[2842] | 9 | extern int verbose; //!< will be obsolete soon. |
---|
[2804] | 10 | |
---|
[2776] | 11 | #include <GL/gl.h> |
---|
| 12 | #include <GL/glu.h> |
---|
[3070] | 13 | #include <SDL/SDL.h> |
---|
[2776] | 14 | #include <stdlib.h> |
---|
[2823] | 15 | #include <fstream> |
---|
[2776] | 16 | |
---|
[2842] | 17 | //! Class to handle Materials. |
---|
[2776] | 18 | class Material |
---|
| 19 | { |
---|
| 20 | public: |
---|
| 21 | Material (); |
---|
| 22 | Material (char* mtlName); |
---|
[2778] | 23 | Material* addMaterial(char* mtlName); |
---|
| 24 | |
---|
[2776] | 25 | void init(void); |
---|
| 26 | ~Material (); |
---|
[2778] | 27 | |
---|
[3070] | 28 | GLuint diffuseTexture; |
---|
| 29 | GLuint ambientTexture; |
---|
| 30 | GLuint specularTexture; |
---|
| 31 | |
---|
| 32 | bool diffuseTextureSet; |
---|
| 33 | bool ambientTextureSet; |
---|
| 34 | bool specularTextureSet; |
---|
[2778] | 35 | |
---|
[2776] | 36 | void setName (char* mtlName); |
---|
[2778] | 37 | char* getName (void); |
---|
[2776] | 38 | void setIllum (int illum); |
---|
| 39 | void setIllum (char* illum); |
---|
| 40 | void setDiffuse (float r, float g, float b); |
---|
| 41 | void setDiffuse (char* rgb); |
---|
| 42 | void setAmbient (float r, float g, float b); |
---|
| 43 | void setAmbient (char* rgb); |
---|
| 44 | void setSpecular (float r, float g, float b); |
---|
| 45 | void setSpecular (char* rgb); |
---|
[2836] | 46 | void setShininess (float shini); |
---|
| 47 | void setShininess (char* shini); |
---|
[2776] | 48 | void setTransparency (float trans); |
---|
| 49 | void setTransparency (char* trans); |
---|
| 50 | |
---|
[3070] | 51 | // MAPPING // |
---|
| 52 | void setDiffuseMap(char* dMap); |
---|
| 53 | void setAmbientMap(char* aMap); |
---|
| 54 | void setSpecularMap(char* sMap); |
---|
| 55 | void setBump(char* bump); |
---|
| 56 | |
---|
| 57 | bool loadBMP (char* bmpName, GLuint* texture); |
---|
| 58 | |
---|
| 59 | |
---|
[2778] | 60 | Material* search (char* mtlName); |
---|
[2776] | 61 | |
---|
| 62 | bool select (void); |
---|
| 63 | |
---|
[2842] | 64 | Material* nextMat; //!< pointer to the Next Material of the List. NULL if no next exists. |
---|
[2778] | 65 | |
---|
[2776] | 66 | private: |
---|
[3069] | 67 | char* name; |
---|
[2776] | 68 | int illumModel; |
---|
[2780] | 69 | float diffuse [4]; |
---|
| 70 | float ambient [4]; |
---|
| 71 | float specular [4]; |
---|
[2836] | 72 | float shininess; |
---|
[2776] | 73 | float transparency; |
---|
| 74 | |
---|
| 75 | }; |
---|
| 76 | #endif |
---|