Changeset 3140 in orxonox.OLD for orxonox/trunk/importer/material.h
- Timestamp:
- Dec 10, 2004, 7:44:36 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/importer/material.h
r3070 r3140 12 12 #include <GL/glu.h> 13 13 #include <SDL/SDL.h> 14 #include <stdlib.h> 15 #include <fstream> 14 15 #if HAVE_CONFIG_H 16 #include <config.h> 17 #endif /* HAVE_CONFIG_H */ 18 19 #ifdef HAVE_SDL_SDL_IMAGE_H 20 #include <SDL/SDL_image.h> 21 #else 22 // IMAGE LIBS // 23 #ifdef HAVE_JPEGLIB_H 24 extern "C"{ // This has to be done, because not a c++ lib 25 #include <jpeglib.h> 26 } 27 #endif /* HAVE_JPEGLIB_H */ 28 #ifdef HAVE_PNG_H 29 #include <png.h> 30 #endif /* HAVE_PNG_H */ 31 #endif /* HAVE_SDL_SDL_IMAGE_H */ 32 33 class PathList 34 { 35 public: 36 PathList(); 37 PathList(char* pName); 38 39 ~PathList(); 40 void addPath (char* pName); 41 char* pathName; 42 PathList* next; 43 }; 44 16 45 17 46 //! Class to handle Materials. … … 22 51 Material (char* mtlName); 23 52 Material* addMaterial(char* mtlName); 53 ~Material (); 54 void init(void); 24 55 25 void init(void); 26 ~Material (); 27 28 GLuint diffuseTexture; 29 GLuint ambientTexture; 30 GLuint specularTexture; 31 32 bool diffuseTextureSet; 33 bool ambientTextureSet; 34 bool specularTextureSet; 56 Material* search (char* mtlName); 57 bool select (void); 35 58 36 59 void setName (char* mtlName); … … 49 72 void setTransparency (char* trans); 50 73 51 // MAPPING // 74 75 76 void addTexturePath(char* pathName); 77 char* searchTextureInPaths(char* texName) const; 78 // MAPPING // 52 79 void setDiffuseMap(char* dMap); 53 80 void setAmbientMap(char* aMap); … … 55 82 void setBump(char* bump); 56 83 57 bool loadBMP (char* bmpName, GLuint* texture); 84 private: 85 struct Image 86 { 87 int rowSpan; 88 GLuint width; 89 GLuint height; 90 GLuint bpp; 91 GLuint type; 92 GLubyte *data; 93 }; 58 94 59 95 60 Material* search (char* mtlName);61 62 bool select (void);63 64 Material* nextMat; //!< pointer to the Next Material of the List. NULL if no next exists.65 66 private:67 96 char* name; 68 97 int illumModel; … … 73 102 float transparency; 74 103 104 static PathList* pathList; 105 106 GLuint diffuseTexture; 107 GLuint ambientTexture; 108 GLuint specularTexture; 109 110 bool diffuseTextureSet; 111 bool ambientTextureSet; 112 bool specularTextureSet; 113 114 Material* nextMat; //!< pointer to the Next Material of the List. NULL if no next exists. 115 116 // TEXTURING 117 bool loadTexToGL (Image* pImage, GLuint* texture); 118 119 bool loadImage(char* imageName, GLuint* texture); 120 #ifndef HAVE_SDL_SDL_IMAGE_H 121 122 bool loadBMP (char* bmpName, GLuint* texture); 123 124 bool loadJPG (char* jpgName, GLuint* texture); 125 126 /// TGA /// 127 128 bool loadTGA(const char * tgaName, GLuint* texture); 129 bool loadUncompressedTGA(const char * filename, FILE * fTGA, GLuint* texture); 130 bool loadCompressedTGA(const char * filename, FILE * fTGA, GLuint* texture); 131 132 bool loadPNG(const char* pngName, GLuint* texture); 133 #endif 75 134 }; 76 135 #endif
Note: See TracChangeset
for help on using the changeset viewer.