]> git.tdb.fi Git - libs/gl.git/commitdiff
Add the missing TexEnv::current() function
authorMikko Rasa <tdb@tdb.fi>
Thu, 15 Jul 2010 15:51:30 +0000 (15:51 +0000)
committerMikko Rasa <tdb@tdb.fi>
Thu, 15 Jul 2010 15:51:30 +0000 (15:51 +0000)
Use current() instead of the more complex invocation in Texture::update_parameter

source/texenv.cpp
source/texenv.h
source/texture.cpp

index 3730a7e188606e85bab9e501730665c33eb42cab..703a8d0a95d0303140d37a5c1af9588e50735cfe 100644 (file)
@@ -38,6 +38,11 @@ void TexEnv::bind() const
        }
 }
 
+const TexEnv *TexEnv::current()
+{
+       return TexUnit::current().get_texenv();
+}
+
 void TexEnv::unbind()
 {
        if(TexUnit::current().set_texenv(0))
index 01e4a556b0431cc6ace9e9b3a16d70c60b6b3037..55704e580ecb4719712ffccef86ec2b5f69b495d 100644 (file)
@@ -38,6 +38,7 @@ public:
        const Color &get_color() const { return color; }
        void bind() const;
 
+       static const TexEnv *current();
        static void unbind();
 };
 
index eca0334795ad838c109bad4ed0aa06cf3e06577e..dc69732fe2f33dafff253b51359898bbcaf1c260 100644 (file)
@@ -60,7 +60,7 @@ Texture::~Texture()
 
 void Texture::update_parameter(int mask) const
 {
-       if(TexUnit::current().get_texture()==this)
+       if(current()==this)
        {
                if(mask&MIN_FILTER)
                        glTexParameteri(target, GL_TEXTURE_MIN_FILTER, min_filter);