]> git.tdb.fi Git - libs/gl.git/commitdiff
Minor fixes to texture anisotropy handling
authorMikko Rasa <tdb@tdb.fi>
Wed, 20 Jun 2018 10:38:16 +0000 (13:38 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 20 Jun 2018 10:38:16 +0000 (13:38 +0300)
Initialize the anisotropy parameter and don't try to set it unless the
extension is supported.

source/texture.cpp

index 1d2ece8074410ded753c621f4c4dd43418e2694d..fb409e895c7fc3a0d221ee829648024462d76a55 100644 (file)
@@ -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)