/*! \file material.h \brief Contains the Material Class that handles Material for 3D-Objects. */ #ifndef _MATERIAL_H #define _MATERIAL_H extern int verbose; //!< will be obsolete soon. #include #include #include #include #include // IMAGE LIBS // extern "C"{ // This has to be done, because not a c++ lib #include } //! Class to handle Materials. class Material { public: Material (); Material (char* mtlName); Material* addMaterial(char* mtlName); ~Material (); void init(void); Material* search (char* mtlName); bool select (void); GLuint diffuseTexture; GLuint ambientTexture; GLuint specularTexture; bool diffuseTextureSet; bool ambientTextureSet; bool specularTextureSet; void setName (char* mtlName); char* getName (void); void setIllum (int illum); void setIllum (char* illum); void setDiffuse (float r, float g, float b); void setDiffuse (char* rgb); void setAmbient (float r, float g, float b); void setAmbient (char* rgb); void setSpecular (float r, float g, float b); void setSpecular (char* rgb); void setShininess (float shini); void setShininess (char* shini); void setTransparency (float trans); void setTransparency (char* trans); // MAPPING // void setDiffuseMap(char* dMap); void setAmbientMap(char* aMap); void setSpecularMap(char* sMap); void setBump(char* bump); private: struct tImageJPG { int rowSpan; int sizeX; int sizeY; unsigned char *data; }; char* name; int illumModel; float diffuse [4]; float ambient [4]; float specular [4]; float shininess; float transparency; Material* nextMat; //!< pointer to the Next Material of the List. NULL if no next exists. // TEXTURING bool loadBMP (char* bmpName, GLuint* texture); bool loadJPG (char* jpgName, GLuint* texture); void decodeJPG(jpeg_decompress_struct* cinfo, tImageJPG *pImageData); }; #endif