]> git.jsancho.org Git - lugaru.git/commitdiff
don't use gluBuild2DMipmaps
authorsf17k <sf171k@gmail.com>
Sat, 4 Jun 2011 04:53:14 +0000 (00:53 -0400)
committersf17k <sf171k@gmail.com>
Sat, 4 Jun 2011 04:53:14 +0000 (00:53 -0400)
Source/Person.h
Source/Texture.cpp

index 9c6ebe968a31ad5222e299ff3165fa567ae3be24..8832a65dbd981527d9ef05f5c32166c03dd716f4 100644 (file)
@@ -413,11 +413,8 @@ class Person
                void DoMipmaps()
                {
                  glBindTexture(GL_TEXTURE_2D, skeleton.drawmodel.textureptr);
-                 gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB,
-                                   skeleton.skinsize,
-                                   skeleton.skinsize,
-                                   GL_RGB, GL_UNSIGNED_BYTE,
-                                   &skeleton.skinText[0]);
+          glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
+                 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, skeleton.skinsize, skeleton.skinsize, 0, GL_RGB, GL_UNSIGNED_BYTE, &skeleton.skinText[0]);
                }
 
                int SphereCheck(XYZ *p1,float radius, XYZ *p, XYZ *move, float *rotate, Model *model);
index a8df84ae9c1b244dd6b70a3c98d6ebc8ab4e62d4..11f421129df60970ddbc7e5d088c21dadacbcd59 100644 (file)
@@ -44,6 +44,7 @@ void Texture::load()  {
                glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, (trilinear?GL_LINEAR_MIPMAP_LINEAR:GL_LINEAR_MIPMAP_NEAREST) );
        else
                glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
+       glTexParameteri( GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE );
        
        skinsize=texture.sizeX;
        
@@ -59,9 +60,9 @@ void Texture::load()  {
                }
                arraySize=tempnum;
 
-               gluBuild2DMipmaps( GL_TEXTURE_2D, type, texture.sizeX, texture.sizeY, GL_RGB, GL_UNSIGNED_BYTE, array );
+        glTexImage2D( GL_TEXTURE_2D, 0, type, texture.sizeX, texture.sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, array );
        } else {
-               gluBuild2DMipmaps( GL_TEXTURE_2D, type, texture.sizeX, texture.sizeY, type, GL_UNSIGNED_BYTE, texture.data );
+        glTexImage2D( GL_TEXTURE_2D, 0, type, texture.sizeX, texture.sizeY, 0, type, GL_UNSIGNED_BYTE, texture.data );
        }
 }