OpenGL anisotropic filtering support, conflicting test results

When checking if anisotropic filtering is supported, I get conflicting results.

if(glewIsSupported("GL_EXT_texture_filter_anisotropic") || GLEW_EXT_texture_filter_anisotropic) { std::cout << "support anisotropic" << std::endl; } GLfloat max; glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &max); std::cout << max << std::endl; 

The output for this section on my machine is:

 16 

Thus, anisotropic filtering 16 is supported, but glewIsSupported , as well as the glew extension string, say the opposite.

Does the GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT sufficiently and incorrectly check glew or is something else happening?

+4
source share
2 answers

There seems to be a known bug in glew where glGetString(GL_EXTENSIONS) used even in the context of OpenGL 3+ instead of glGetStringi , which is replaced by an extension request in OpenGL 3+.

So, until it is fixed, the extension request must be executed manually .

+2
source

A possible way to solve the chicken and egg problem is to call glGetString (GL_EXTENSIONS) and check glGetError () for GL_INVALID_ENUM. This should only be done if GL_EXTENSIONS is not available. If you encounter this error, try glGetStringi. Be sure to also check for errors here. GLEW does not work (since version 1.10: /).

0
source

Source: https://habr.com/ru/post/1498983/


All Articles