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