diff --git a/src/AbstractTexture.h b/src/AbstractTexture.h index 65fc80203..35bd33f76 100644 --- a/src/AbstractTexture.h +++ b/src/AbstractTexture.h @@ -278,7 +278,7 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject { * available, this function does nothing. If * @extension{EXT,direct_state_access} is not available, the texture is * bound to some layer before the operation. - * @see @ref Sampler::maxAnisotropy(), @fn_gl{ActiveTexture}, + * @see @ref Sampler::maxMaxAnisotropy(), @fn_gl{ActiveTexture}, * @fn_gl{BindTexture} and @fn_gl{TexParameter} or * @fn_gl_extension{TextureParameter,EXT,direct_state_access} with * @def_gl{TEXTURE_MAX_ANISOTROPY_EXT} diff --git a/src/Implementation/TextureState.cpp b/src/Implementation/TextureState.cpp index 68e36264f..689b7aa40 100644 --- a/src/Implementation/TextureState.cpp +++ b/src/Implementation/TextureState.cpp @@ -26,7 +26,7 @@ namespace Magnum { namespace Implementation { -TextureState::TextureState(): maxAnisotropy(0.0f), currentLayer(0) +TextureState::TextureState(): maxMaxAnisotropy(0.0f), currentLayer(0) #ifndef MAGNUM_TARGET_GLES , maxColorSamples(0), maxDepthSamples(0), maxIntegerSamples(0), bufferOffsetAlignment(0) #endif diff --git a/src/Implementation/TextureState.h b/src/Implementation/TextureState.h index 54508124b..ab5d237fa 100644 --- a/src/Implementation/TextureState.h +++ b/src/Implementation/TextureState.h @@ -34,7 +34,7 @@ struct TextureState { explicit TextureState(); ~TextureState(); - GLfloat maxAnisotropy; + GLfloat maxMaxAnisotropy; GLint currentLayer; #ifndef MAGNUM_TARGET_GLES GLint maxColorSamples, diff --git a/src/Platform/magnum-info.cpp b/src/Platform/magnum-info.cpp index 854c5f107..1d9f8e386 100644 --- a/src/Platform/magnum-info.cpp +++ b/src/Platform/magnum-info.cpp @@ -355,7 +355,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat if(c->isExtensionSupported()) { _h(EXT::texture_filter_anisotropic) - _l(Sampler::maxAnisotropy()) + _l(Sampler::maxMaxAnisotropy()) } if(c->isExtensionSupported()) { diff --git a/src/Sampler.cpp b/src/Sampler.cpp index eae511626..9e6a9311e 100644 --- a/src/Sampler.cpp +++ b/src/Sampler.cpp @@ -46,11 +46,11 @@ static_assert((filter_or(Nearest, Base) == GL_NEAREST) && "Unsupported constants for GL texture filtering"); #undef filter_or -Float Sampler::maxAnisotropy() { +Float Sampler::maxMaxAnisotropy() { if(!Context::current()->isExtensionSupported()) return 0.0f; - GLfloat& value = Context::current()->state().texture->maxAnisotropy; + GLfloat& value = Context::current()->state().texture->maxMaxAnisotropy; /* Get the value, if not already cached */ if(value == 0.0f) diff --git a/src/Sampler.h b/src/Sampler.h index 7ffcb055f..974d60c2e 100644 --- a/src/Sampler.h +++ b/src/Sampler.h @@ -133,22 +133,29 @@ class MAGNUM_EXPORT Sampler { }; /** - * @brief Max supported anisotropy + * @brief Max supported max anisotropy * * The result is cached, repeated queries don't result in repeated * OpenGL calls. If extension @extension{EXT,texture_filter_anisotropic} * (desktop or ES) is not available, returns `0.0f`. * @see setMaxAnisotropy(), @fn_gl{Get} with @def_gl{MAX_TEXTURE_MAX_ANISOTROPY_EXT} */ - static Float maxAnisotropy(); + static Float maxMaxAnisotropy(); #ifdef MAGNUM_BUILD_DEPRECATED /** - * @copybrief maxAnisotropy() - * @deprecated Use @ref Magnum::Sampler::maxAnisotropy() "maxAnisotropy()" + * @copybrief maxMaxAnisotropy() + * @deprecated Use @ref Magnum::Sampler::maxMaxAnisotropy() "maxMaxAnisotropy()" * instead. */ - static CORRADE_DEPRECATED("use maxAnisotropy() instead") Float maxSupportedAnisotropy() { return maxAnisotropy(); } + static CORRADE_DEPRECATED("use maxMaxAnisotropy() instead") Float maxAnisotropy() { return maxMaxAnisotropy(); } + + /** + * @copybrief maxMaxAnisotropy() + * @deprecated Use @ref Magnum::Sampler::maxMaxAnisotropy() "maxMaxAnisotropy()" + * instead. + */ + static CORRADE_DEPRECATED("use maxMaxAnisotropy() instead") Float maxSupportedAnisotropy() { return maxMaxAnisotropy(); } #endif }; diff --git a/src/Test/CubeMapTextureArrayGLTest.cpp b/src/Test/CubeMapTextureArrayGLTest.cpp index 5c7206dfb..455f24cfe 100644 --- a/src/Test/CubeMapTextureArrayGLTest.cpp +++ b/src/Test/CubeMapTextureArrayGLTest.cpp @@ -85,7 +85,7 @@ void CubeMapTextureArrayGLTest::sampling() { .setMagnificationFilter(Sampler::Filter::Linear) .setWrapping(Sampler::Wrapping::ClampToBorder) .setBorderColor(Color3(0.5f)) - .setMaxAnisotropy(Sampler::maxAnisotropy()); + .setMaxAnisotropy(Sampler::maxMaxAnisotropy()); MAGNUM_VERIFY_NO_ERROR(); } diff --git a/src/Test/CubeMapTextureGLTest.cpp b/src/Test/CubeMapTextureGLTest.cpp index ac3268758..387f81018 100644 --- a/src/Test/CubeMapTextureGLTest.cpp +++ b/src/Test/CubeMapTextureGLTest.cpp @@ -87,7 +87,7 @@ void CubeMapTextureGLTest::sampling() { .setMagnificationFilter(Sampler::Filter::Linear) .setWrapping(Sampler::Wrapping::ClampToBorder) .setBorderColor(Color3(0.5f)) - .setMaxAnisotropy(Sampler::maxAnisotropy()); + .setMaxAnisotropy(Sampler::maxMaxAnisotropy()); MAGNUM_VERIFY_NO_ERROR(); } diff --git a/src/Test/TextureGLTest.cpp b/src/Test/TextureGLTest.cpp index 58e192ce9..73edceb96 100644 --- a/src/Test/TextureGLTest.cpp +++ b/src/Test/TextureGLTest.cpp @@ -491,7 +491,7 @@ void TextureGLTest::sampling1D() { .setMagnificationFilter(Sampler::Filter::Linear) .setWrapping(Sampler::Wrapping::ClampToBorder) .setBorderColor(Color3(0.5f)) - .setMaxAnisotropy(Sampler::maxAnisotropy()); + .setMaxAnisotropy(Sampler::maxMaxAnisotropy()); MAGNUM_VERIFY_NO_ERROR(); } @@ -507,7 +507,7 @@ void TextureGLTest::sampling2D() { #else .setWrapping(Sampler::Wrapping::ClampToEdge) #endif - .setMaxAnisotropy(Sampler::maxAnisotropy()); + .setMaxAnisotropy(Sampler::maxMaxAnisotropy()); MAGNUM_VERIFY_NO_ERROR(); } @@ -540,7 +540,7 @@ void TextureGLTest::sampling3D() { #else .setWrapping(Sampler::Wrapping::ClampToEdge) #endif - .setMaxAnisotropy(Sampler::maxAnisotropy()); + .setMaxAnisotropy(Sampler::maxMaxAnisotropy()); MAGNUM_VERIFY_NO_ERROR(); } @@ -573,7 +573,7 @@ void TextureGLTest::sampling1DArray() { .setMagnificationFilter(Sampler::Filter::Linear) .setWrapping(Sampler::Wrapping::ClampToBorder) .setBorderColor(Color3(0.5f)) - .setMaxAnisotropy(Sampler::maxAnisotropy()); + .setMaxAnisotropy(Sampler::maxMaxAnisotropy()); MAGNUM_VERIFY_NO_ERROR(); } @@ -595,7 +595,7 @@ void TextureGLTest::sampling2DArray() { #else .setWrapping(Sampler::Wrapping::ClampToEdge) #endif - .setMaxAnisotropy(Sampler::maxAnisotropy()); + .setMaxAnisotropy(Sampler::maxMaxAnisotropy()); MAGNUM_VERIFY_NO_ERROR(); } @@ -624,7 +624,7 @@ void TextureGLTest::samplingRectangle() { .setMagnificationFilter(Sampler::Filter::Linear) .setWrapping(Sampler::Wrapping::ClampToBorder) .setBorderColor(Color3(0.5f)) - .setMaxAnisotropy(Sampler::maxAnisotropy()); + .setMaxAnisotropy(Sampler::maxMaxAnisotropy()); MAGNUM_VERIFY_NO_ERROR(); } diff --git a/src/Texture.h b/src/Texture.h index ad63a0b07..b765c0fa9 100644 --- a/src/Texture.h +++ b/src/Texture.h @@ -51,7 +51,7 @@ Texture2D texture; texture.setMagnificationFilter(Sampler::Filter::Linear) .setMinificationFilter(Sampler::Filter::Linear, Sampler::Mipmap::Linear) .setWrapping(Sampler::Wrapping::ClampToEdge) - .setMaxAnisotropy(Sampler::maxAnisotropy()) + .setMaxAnisotropy(Sampler::maxMaxAnisotropy()) .setStorage(Math::log2(4096)+1, TextureFormat::RGBA8, {4096, 4096}) .setSubImage(0, {}, image) .generateMipmap();