diff --git a/source/src/texture.cpp b/source/src/texture.cpp index 39fc5706..93c9d5b7 100644 --- a/source/src/texture.cpp +++ b/source/src/texture.cpp @@ -139,13 +139,30 @@ void uploadtexture(GLenum target, GLenum internal, int tw, int th, GLenum format } if(buf) delete[] buf; } +void check_anisotropy() +{ + float largest_supported_anisotropy; + glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &largest_supported_anisotropy); + conoutf("your card reports: %3.1f as max ansiotropy value", largest_supported_anisotropy); +} +COMMAND(check_anisotropy, ARG_NONE); +VARP(anisotropy, 0, 0, 16); void createtexture(int tnum, int w, int h, void *pixels, int clamp, bool mipmap, bool canreduce, GLenum format) { glBindTexture(GL_TEXTURE_2D, tnum); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, clamp&1 ? GL_CLAMP_TO_EDGE : GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, clamp&2 ? GL_CLAMP_TO_EDGE : GL_REPEAT); + switch(anisotropy) + { + case 1: + case 2: + case 4: + case 8: + case 16: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, aniso); break; + default: break; + } glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, bilinear ? GL_LINEAR : GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, mipmap ?