Changeset 4159 in orxonox.OLD for orxonox/branches/md2_loader/src/lib
- Timestamp:
- May 11, 2005, 12:35:32 AM (20 years ago)
- Location:
- orxonox/branches/md2_loader/src/lib/graphics/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/md2_loader/src/lib/graphics/importer/abstract_model.h
r4158 r4159 182 182 }; 183 183 184 class Helper185 {186 187 public:188 189 static void createTexture(unsigned int textureArray[], char* strFileName, int textureID)190 {191 SDL_Surface *image = NULL;192 193 if(!strFileName)194 return;195 196 image = IMG_Load(strFileName);197 if( !image)198 PRINTF(0)("IMG_Load: %s\n", IMG_GetError());199 200 glGenTextures(1, &textureArray[textureID]);201 glPixelStorei (GL_UNPACK_ALIGNMENT, 1);202 glBindTexture(GL_TEXTURE_2D, textureArray[textureID]);203 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);204 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR_MIPMAP_LINEAR);205 gluBuild2DMipmaps(GL_TEXTURE_2D, 3, image->w, image->h, GL_RGB, GL_UNSIGNED_BYTE, image->pixels);206 207 SDL_FreeSurface(image);208 }209 210 };211 184 212 185 #endif /* _ABSTRACT_MODEL_H */ -
orxonox/branches/md2_loader/src/lib/graphics/importer/md2Model.cc
r4158 r4159 56 56 { 57 57 if( pModel->objectList.size() <= 0) return; 58 59 glEnable(GL_TEXTURE_2D);60 //glBindTexture(GL_TEXTURE_2D, this->diffuseTexture->getTexture());61 58 62 59 t3DObject *pObject = &pModel->objectList[0]; … … 80 77 } 81 78 glEnd(); 82 83 glDisable(GL_TEXTURE_2D);84 79 } 85 80
Note: See TracChangeset
for help on using the changeset viewer.