Browse Source

Renamed Sampler::maxAnisotropy() to Sampler::maxMaxAnisotropy().

Finally a non-confusing name, hopefully. Sorry it took me too long. The
original Sampler::maxAnisotropy() (and also
Sampler::maxSupportedAnisotropy()) is now alias to the new one, is
marked as deprecated and will be removed in future release.
pull/51/head
Vladimír Vondruš 13 years ago
parent
commit
bd955a77b7
  1. 2
      src/AbstractTexture.h
  2. 2
      src/Implementation/TextureState.cpp
  3. 2
      src/Implementation/TextureState.h
  4. 2
      src/Platform/magnum-info.cpp
  5. 4
      src/Sampler.cpp
  6. 17
      src/Sampler.h
  7. 2
      src/Test/CubeMapTextureArrayGLTest.cpp
  8. 2
      src/Test/CubeMapTextureGLTest.cpp
  9. 12
      src/Test/TextureGLTest.cpp
  10. 2
      src/Texture.h

2
src/AbstractTexture.h

@ -278,7 +278,7 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject {
* available, this function does nothing. If * available, this function does nothing. If
* @extension{EXT,direct_state_access} is not available, the texture is * @extension{EXT,direct_state_access} is not available, the texture is
* bound to some layer before the operation. * 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{BindTexture} and @fn_gl{TexParameter} or
* @fn_gl_extension{TextureParameter,EXT,direct_state_access} with * @fn_gl_extension{TextureParameter,EXT,direct_state_access} with
* @def_gl{TEXTURE_MAX_ANISOTROPY_EXT} * @def_gl{TEXTURE_MAX_ANISOTROPY_EXT}

2
src/Implementation/TextureState.cpp

@ -26,7 +26,7 @@
namespace Magnum { namespace Implementation { namespace Magnum { namespace Implementation {
TextureState::TextureState(): maxAnisotropy(0.0f), currentLayer(0) TextureState::TextureState(): maxMaxAnisotropy(0.0f), currentLayer(0)
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
, maxColorSamples(0), maxDepthSamples(0), maxIntegerSamples(0), bufferOffsetAlignment(0) , maxColorSamples(0), maxDepthSamples(0), maxIntegerSamples(0), bufferOffsetAlignment(0)
#endif #endif

2
src/Implementation/TextureState.h

@ -34,7 +34,7 @@ struct TextureState {
explicit TextureState(); explicit TextureState();
~TextureState(); ~TextureState();
GLfloat maxAnisotropy; GLfloat maxMaxAnisotropy;
GLint currentLayer; GLint currentLayer;
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
GLint maxColorSamples, GLint maxColorSamples,

2
src/Platform/magnum-info.cpp

@ -355,7 +355,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
if(c->isExtensionSupported<Extensions::GL::EXT::texture_filter_anisotropic>()) { if(c->isExtensionSupported<Extensions::GL::EXT::texture_filter_anisotropic>()) {
_h(EXT::texture_filter_anisotropic) _h(EXT::texture_filter_anisotropic)
_l(Sampler::maxAnisotropy()) _l(Sampler::maxMaxAnisotropy())
} }
if(c->isExtensionSupported<Extensions::GL::KHR::debug>()) { if(c->isExtensionSupported<Extensions::GL::KHR::debug>()) {

4
src/Sampler.cpp

@ -46,11 +46,11 @@ static_assert((filter_or(Nearest, Base) == GL_NEAREST) &&
"Unsupported constants for GL texture filtering"); "Unsupported constants for GL texture filtering");
#undef filter_or #undef filter_or
Float Sampler::maxAnisotropy() { Float Sampler::maxMaxAnisotropy() {
if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_filter_anisotropic>()) if(!Context::current()->isExtensionSupported<Extensions::GL::EXT::texture_filter_anisotropic>())
return 0.0f; return 0.0f;
GLfloat& value = Context::current()->state().texture->maxAnisotropy; GLfloat& value = Context::current()->state().texture->maxMaxAnisotropy;
/* Get the value, if not already cached */ /* Get the value, if not already cached */
if(value == 0.0f) if(value == 0.0f)

17
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 * The result is cached, repeated queries don't result in repeated
* OpenGL calls. If extension @extension{EXT,texture_filter_anisotropic} * OpenGL calls. If extension @extension{EXT,texture_filter_anisotropic}
* (desktop or ES) is not available, returns `0.0f`. * (desktop or ES) is not available, returns `0.0f`.
* @see setMaxAnisotropy(), @fn_gl{Get} with @def_gl{MAX_TEXTURE_MAX_ANISOTROPY_EXT} * @see setMaxAnisotropy(), @fn_gl{Get} with @def_gl{MAX_TEXTURE_MAX_ANISOTROPY_EXT}
*/ */
static Float maxAnisotropy(); static Float maxMaxAnisotropy();
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED
/** /**
* @copybrief maxAnisotropy() * @copybrief maxMaxAnisotropy()
* @deprecated Use @ref Magnum::Sampler::maxAnisotropy() "maxAnisotropy()" * @deprecated Use @ref Magnum::Sampler::maxMaxAnisotropy() "maxMaxAnisotropy()"
* instead. * 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 #endif
}; };

2
src/Test/CubeMapTextureArrayGLTest.cpp

@ -85,7 +85,7 @@ void CubeMapTextureArrayGLTest::sampling() {
.setMagnificationFilter(Sampler::Filter::Linear) .setMagnificationFilter(Sampler::Filter::Linear)
.setWrapping(Sampler::Wrapping::ClampToBorder) .setWrapping(Sampler::Wrapping::ClampToBorder)
.setBorderColor(Color3(0.5f)) .setBorderColor(Color3(0.5f))
.setMaxAnisotropy(Sampler::maxAnisotropy()); .setMaxAnisotropy(Sampler::maxMaxAnisotropy());
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
} }

2
src/Test/CubeMapTextureGLTest.cpp

@ -87,7 +87,7 @@ void CubeMapTextureGLTest::sampling() {
.setMagnificationFilter(Sampler::Filter::Linear) .setMagnificationFilter(Sampler::Filter::Linear)
.setWrapping(Sampler::Wrapping::ClampToBorder) .setWrapping(Sampler::Wrapping::ClampToBorder)
.setBorderColor(Color3(0.5f)) .setBorderColor(Color3(0.5f))
.setMaxAnisotropy(Sampler::maxAnisotropy()); .setMaxAnisotropy(Sampler::maxMaxAnisotropy());
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
} }

12
src/Test/TextureGLTest.cpp

@ -491,7 +491,7 @@ void TextureGLTest::sampling1D() {
.setMagnificationFilter(Sampler::Filter::Linear) .setMagnificationFilter(Sampler::Filter::Linear)
.setWrapping(Sampler::Wrapping::ClampToBorder) .setWrapping(Sampler::Wrapping::ClampToBorder)
.setBorderColor(Color3(0.5f)) .setBorderColor(Color3(0.5f))
.setMaxAnisotropy(Sampler::maxAnisotropy()); .setMaxAnisotropy(Sampler::maxMaxAnisotropy());
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
} }
@ -507,7 +507,7 @@ void TextureGLTest::sampling2D() {
#else #else
.setWrapping(Sampler::Wrapping::ClampToEdge) .setWrapping(Sampler::Wrapping::ClampToEdge)
#endif #endif
.setMaxAnisotropy(Sampler::maxAnisotropy()); .setMaxAnisotropy(Sampler::maxMaxAnisotropy());
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
} }
@ -540,7 +540,7 @@ void TextureGLTest::sampling3D() {
#else #else
.setWrapping(Sampler::Wrapping::ClampToEdge) .setWrapping(Sampler::Wrapping::ClampToEdge)
#endif #endif
.setMaxAnisotropy(Sampler::maxAnisotropy()); .setMaxAnisotropy(Sampler::maxMaxAnisotropy());
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
} }
@ -573,7 +573,7 @@ void TextureGLTest::sampling1DArray() {
.setMagnificationFilter(Sampler::Filter::Linear) .setMagnificationFilter(Sampler::Filter::Linear)
.setWrapping(Sampler::Wrapping::ClampToBorder) .setWrapping(Sampler::Wrapping::ClampToBorder)
.setBorderColor(Color3(0.5f)) .setBorderColor(Color3(0.5f))
.setMaxAnisotropy(Sampler::maxAnisotropy()); .setMaxAnisotropy(Sampler::maxMaxAnisotropy());
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
} }
@ -595,7 +595,7 @@ void TextureGLTest::sampling2DArray() {
#else #else
.setWrapping(Sampler::Wrapping::ClampToEdge) .setWrapping(Sampler::Wrapping::ClampToEdge)
#endif #endif
.setMaxAnisotropy(Sampler::maxAnisotropy()); .setMaxAnisotropy(Sampler::maxMaxAnisotropy());
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
} }
@ -624,7 +624,7 @@ void TextureGLTest::samplingRectangle() {
.setMagnificationFilter(Sampler::Filter::Linear) .setMagnificationFilter(Sampler::Filter::Linear)
.setWrapping(Sampler::Wrapping::ClampToBorder) .setWrapping(Sampler::Wrapping::ClampToBorder)
.setBorderColor(Color3(0.5f)) .setBorderColor(Color3(0.5f))
.setMaxAnisotropy(Sampler::maxAnisotropy()); .setMaxAnisotropy(Sampler::maxMaxAnisotropy());
MAGNUM_VERIFY_NO_ERROR(); MAGNUM_VERIFY_NO_ERROR();
} }

2
src/Texture.h

@ -51,7 +51,7 @@ Texture2D texture;
texture.setMagnificationFilter(Sampler::Filter::Linear) texture.setMagnificationFilter(Sampler::Filter::Linear)
.setMinificationFilter(Sampler::Filter::Linear, Sampler::Mipmap::Linear) .setMinificationFilter(Sampler::Filter::Linear, Sampler::Mipmap::Linear)
.setWrapping(Sampler::Wrapping::ClampToEdge) .setWrapping(Sampler::Wrapping::ClampToEdge)
.setMaxAnisotropy(Sampler::maxAnisotropy()) .setMaxAnisotropy(Sampler::maxMaxAnisotropy())
.setStorage(Math::log2(4096)+1, TextureFormat::RGBA8, {4096, 4096}) .setStorage(Math::log2(4096)+1, TextureFormat::RGBA8, {4096, 4096})
.setSubImage(0, {}, image) .setSubImage(0, {}, image)
.generateMipmap(); .generateMipmap();

Loading…
Cancel
Save