From: Mikko Rasa Date: Wed, 20 Jun 2018 10:38:16 +0000 (+0300) Subject: Minor fixes to texture anisotropy handling X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=4cb33c263a00787a57531dfc41a4128bf34d7bee;p=libs%2Fgl.git Minor fixes to texture anisotropy handling Initialize the anisotropy parameter and don't try to set it unless the extension is supported. --- 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)