diff --git a/src/engine/rendergl.cpp b/src/engine/rendergl.cpp index 61a48e9c6..df3b5d66c 100644 --- a/src/engine/rendergl.cpp +++ b/src/engine/rendergl.cpp @@ -562,13 +562,14 @@ void gl_checkextensions() if(glversion < 300 && dbgexts) conoutf("\frUsing GL_ARB_texture_compression_rgtc extension."); } - if(hasext("GL_EXT_texture_filter_anisotropic")) - { + if ((glversion >= 460 || hasext("GL_ARB_texture_filter_anisotropic")) || + hasext("GL_EXT_texture_filter_anisotropic")) { GLint val; - glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &val); + glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY, &val); hwmaxanisotropy = val; hasAF = true; - if(dbgexts) conoutf("\frUsing GL_EXT_texture_filter_anisotropic extension."); + if (dbgexts) + conoutf("\frUsing GL_*_texture_filter_anisotropic extension."); } if(glversion >= 300 || hasext("GL_EXT_gpu_shader4")) diff --git a/src/engine/texture.cpp b/src/engine/texture.cpp index aa900143b..36991432c 100644 --- a/src/engine/texture.cpp +++ b/src/engine/texture.cpp @@ -784,7 +784,8 @@ void setuptexparameters(int tnum, void *pixels, int clamp, int filter, GLenum fo glBindTexture(target, tnum); glTexParameteri(target, GL_TEXTURE_WRAP_S, clamp&1 ? GL_CLAMP_TO_EDGE : (clamp&0x100 ? GL_MIRRORED_REPEAT : GL_REPEAT)); if(target!=GL_TEXTURE_1D) glTexParameteri(target, GL_TEXTURE_WRAP_T, clamp&2 ? GL_CLAMP_TO_EDGE : (clamp&0x200 ? GL_MIRRORED_REPEAT : GL_REPEAT)); - if(target==GL_TEXTURE_2D && hasAF && min(anisotropy, hwmaxanisotropy) > 0 && filter > 1) glTexParameteri(target, GL_TEXTURE_MAX_ANISOTROPY_EXT, min(anisotropy, hwmaxanisotropy)); + if (target == GL_TEXTURE_2D && hasAF && min(anisotropy, hwmaxanisotropy) > 0 && filter > 1) + glTexParameteri(target, GL_TEXTURE_MAX_ANISOTROPY, min(anisotropy, hwmaxanisotropy)); glTexParameteri(target, GL_TEXTURE_MAG_FILTER, filter && bilinear ? GL_LINEAR : GL_NEAREST); glTexParameteri(target, GL_TEXTURE_MIN_FILTER, filter > 1 ? diff --git a/src/shared/glexts.h b/src/shared/glexts.h index 3d070f3ac..5e3e24fc4 100644 --- a/src/shared/glexts.h +++ b/src/shared/glexts.h @@ -289,10 +289,10 @@ extern PFNGLDRAWBUFFERSPROC glDrawBuffers_; #define GL_PIXEL_UNPACK_BUFFER 0x88EC #endif -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#ifndef GL_ARB_texture_filter_anisotropic +#define GL_ARB_texture_filter_anisotropic 1 +#define GL_TEXTURE_MAX_ANISOTROPY 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY 0x84FF #endif #ifndef GL_EXT_texture_compression_s3tc