Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 16, 2005, 2:01:16 PM (18 years ago)
Author:
patrick
Message:

network: read some stuff about textures, extending the texture class. not yet finished

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/graphics/importer/texture.cc

    r5863 r6129  
    3737  this->texture = 0;
    3838  this->image = NULL;
     39  this->priority = 0.5;
    3940
    4041  if (imageName != NULL)
     
    251252  glGenTextures(1, &texture);
    252253  glBindTexture(GL_TEXTURE_2D, texture);
    253   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    254   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     254
     255  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, /*GL_LINEAR*/ GL_LINEAR_MIPMAP_LINEAR);
     256  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, /*GL_LINEAR*/ GL_LINEAR);
     257  /* control the mipmap levels */
     258  glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MIN_LOD, -100);
     259  glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MAX_LOD, 0);
     260  glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_PRIORITY, this->priority);
     261
    255262  // build the Texture
    256263  glTexImage2D(GL_TEXTURE_2D,
     
    262269               GL_UNSIGNED_BYTE,
    263270               surface->pixels);
    264   // build the MipMaps
     271
     272  // build the MipMaps automaticaly
    265273  gluBuild2DMipmaps(GL_TEXTURE_2D,
    266274                    GL_RGBA,
     
    273281  return texture;
    274282}
     283
Note: See TracChangeset for help on using the changeset viewer.