From 4cb33c263a00787a57531dfc41a4128bf34d7bee Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 20 Jun 2018 13:38:16 +0300 Subject: [PATCH] Minor fixes to texture anisotropy handling Initialize the anisotropy parameter and don't try to set it unless the extension is supported. --- source/texture.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/texture.cpp b/source/texture.cpp index 1d2ece80..fb409e89 100644 --- a/source/texture.cpp +++ b/source/texture.cpp @@ -63,6 +63,7 @@ Texture::Texture(GLenum t, ResourceManager *m): ifmt(RGB), min_filter(NEAREST_MIPMAP_LINEAR), mag_filter(LINEAR), + max_anisotropy(1.0f), wrap_s(REPEAT), wrap_t(REPEAT), wrap_r(REPEAT), @@ -220,7 +221,8 @@ void Texture::set_max_anisotropy(float a) else if(a>1.0f) static Require _req(EXT_texture_filter_anisotropic); max_anisotropy = a; - update_parameter(MAX_ANISOTROPY); + if(EXT_texture_filter_anisotropic) + update_parameter(MAX_ANISOTROPY); } void Texture::set_wrap(TextureWrap w) -- 2.45.2