From 0b17f4c9ceea16e434df32a4dbf4d066cbfff21f Mon Sep 17 00:00:00 2001 From: sf17k Date: Sat, 4 Jun 2011 00:53:14 -0400 Subject: [PATCH] don't use gluBuild2DMipmaps --- Source/Person.h | 7 ++----- Source/Texture.cpp | 5 +++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Source/Person.h b/Source/Person.h index 9c6ebe9..8832a65 100644 --- a/Source/Person.h +++ b/Source/Person.h @@ -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); diff --git a/Source/Texture.cpp b/Source/Texture.cpp index a8df84a..11f4211 100644 --- a/Source/Texture.cpp +++ b/Source/Texture.cpp @@ -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 ); } } -- 2.39.5