]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
made gl_texture_anisotropy take effect immediately like gl_texturemode rather than...
authortomaz <tomaz@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 17 Jul 2004 20:15:25 +0000 (20:15 +0000)
committertomaz <tomaz@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 17 Jul 2004 20:15:25 +0000 (20:15 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4275 d7cf8633-e32d-0410-b094-e92efae38249

gl_textures.c

index 9b1181ec1dc9c2513383bb3132eaa24a0ceb9d8e..1ada32e46fdaad1fffb0f524b652a70c5efec2e2 100644 (file)
@@ -530,6 +530,8 @@ void R_Textures_Init (void)
 
 void R_Textures_Frame (void)
 {
+       static  old_aniso = 0;
+
        // could do procedural texture animation here, if we keep track of which
        // textures were accessed this frame...
 
@@ -545,6 +547,34 @@ void R_Textures_Frame (void)
                Mem_Free(colorconvertbuffer);
                colorconvertbuffer = NULL;
        }
+
+       if (old_aniso != gl_texture_anisotropy.integer)
+       {
+               gltextureimage_t *image;
+               gltexturepool_t *pool;
+               GLint oldbindtexnum;
+
+               old_aniso = bound(1, gl_texture_anisotropy.integer, gl_max_anisotropy);
+               
+               Cvar_SetValueQuick(&gl_texture_anisotropy, old_aniso);
+
+               for (pool = gltexturepoolchain;pool;pool = pool->next)
+               {
+                       for (image = pool->imagechain;image;image = image->imagechain)
+                       {
+                               // only update already uploaded images
+                               if (!(image->flags & GLTEXF_UPLOAD))
+                               {
+                                       qglGetIntegerv(gltexturetypebindingenums[image->texturetype], &oldbindtexnum);
+
+                                       qglBindTexture(gltexturetypeenums[image->texturetype], image->texnum);
+                                       qglTexParameteri(gltexturetypeenums[image->texturetype], GL_TEXTURE_MAX_ANISOTROPY_EXT, old_aniso);CHECKGLERROR
+
+                                       qglBindTexture(gltexturetypeenums[image->texturetype], oldbindtexnum);
+                               }
+                       }
+               }
+       }
 }
 
 void R_MakeResizeBufferBigger(int size)