Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

File:
1 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 */
Note: See TracChangeset for help on using the changeset viewer.