Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4159 in orxonox.OLD for orxonox/branches/md2_loader/src/lib


Ignore:
Timestamp:
May 11, 2005, 12:35:32 AM (20 years ago)
Author:
patrick
Message:

orxonox/branches/md2_loader: cleaned out the unuseable texture loader and fixed also some minor issues

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  
    182182};
    183183
    184 class Helper
    185 {
    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 };
    211184
    212185#endif /* _ABSTRACT_MODEL_H */
  • orxonox/branches/md2_loader/src/lib/graphics/importer/md2Model.cc

    r4158 r4159  
    5656{
    5757  if( pModel->objectList.size() <= 0) return;
    58 
    59   glEnable(GL_TEXTURE_2D);
    60   //glBindTexture(GL_TEXTURE_2D, this->diffuseTexture->getTexture());
    6158
    6259  t3DObject *pObject = &pModel->objectList[0];
     
    8077    }
    8178  glEnd();
    82 
    83   glDisable(GL_TEXTURE_2D);
    8479}
    8580
Note: See TracChangeset for help on using the changeset viewer.