/*! \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); 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 Image { int rowSpan; unsigned long sizeX; unsigned long sizeY; GLubyte *data; }; char* name; int illumModel; float diffuse [4]; float ambient [4]; float specular [4]; float shininess; float transparency; GLuint diffuseTexture; GLuint ambientTexture; GLuint specularTexture; bool diffuseTextureSet; bool ambientTextureSet; bool specularTextureSet; Material* nextMat; //!< pointer to the Next Material of the List. NULL if no next exists. // TEXTURING bool loadImage(char* imageName, GLuint* texture); bool loadBMP (char* bmpName, GLuint* texture); bool loadJPG (char* jpgName, GLuint* texture); void decodeJPG(jpeg_decompress_struct* cinfo, Image *pImageData); bool loadTexToGL (Image* pImage, GLuint* texture); }; #endif