Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6145 in orxonox.OLD for trunk/src/lib/graphics/importer


Ignore:
Timestamp:
Dec 16, 2005, 11:46:55 PM (19 years ago)
Author:
patrick
Message:

trunk: fixed the network bug, uninitialized variable :D

File:
1 edited

Legend:

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

    r6139 r6145  
    260260  glBindTexture(GL_TEXTURE_2D, texture);
    261261
    262   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, /*GL_LINEAR*/ GL_LINEAR_MIPMAP_LINEAR);
    263   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, /*GL_LINEAR*/ GL_LINEAR);
     262  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
     263  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
     264  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
     265  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
     266
    264267  /* control the mipmap levels */
    265268  glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MIN_LOD, -100);
     
    289292    PRINTF(1)("Error while loading texture, gluBuild2DMipmaps returned %i\n", errorCode);
    290293
    291 #define max(a,b) (a>b)?a:b
    292   mipmapLevel = (int)(log2f(max(surface->w, surface->h)));
    293 #undef max
    294   PRINTF(5)("Built the texture mipmpaps, got: %i levels of detail\n", mipmapLevel);
     294// #define max(a,b) (a>b)?a:b
     295//   mipmapLevel = (int)(log2f(max(surface->w, surface->h)));
     296// #undef max
     297//   PRINTF(5)("Built the texture mipmpaps, got: %i levels of detail\n", mipmapLevel);
    295298
    296299  /* now actualy load the mipmaps into the graphics memory */
    297   glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 1, GL_TEXTURE_WIDTH, &mipmapWidth);
    298   glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 1, GL_TEXTURE_WIDTH, &mipmapHight);
    299   PRINTF(5)(" Mipmap at level %i has a %ix%i resolution\n", 1, mipmapWidth, mipmapHight);
    300   glTexImage2D(GL_PROXY_TEXTURE_2D,
    301                1,
    302                GL_RGBA,
    303                mipmapWidth, mipmapHight,
    304                0,
    305                GL_RGBA,
    306                GL_UNSIGNED_BYTE,
    307                NULL
    308                );
     300//   glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 1, GL_TEXTURE_WIDTH, &mipmapWidth);
     301//   glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 1, GL_TEXTURE_WIDTH, &mipmapHight);
     302//   PRINTF(5)(" Mipmap at level %i has a %ix%i resolution\n", 1, mipmapWidth, mipmapHight);
     303//   glTexImage2D(GL_PROXY_TEXTURE_2D,
     304//                1,
     305//                GL_RGBA,
     306//                mipmapWidth, mipmapHight,
     307//                0,
     308//                GL_RGBA,
     309//                GL_UNSIGNED_BYTE,
     310//                NULL
     311//                );
    309312
    310313  glBindTexture(GL_TEXTURE_2D, 0);
Note: See TracChangeset for help on using the changeset viewer.