From: Mikko Rasa Date: Thu, 15 Jul 2010 15:51:30 +0000 (+0000) Subject: Add the missing TexEnv::current() function X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=020811d96d5c823686e5c2b0a392b95d1a321f05;p=libs%2Fgl.git Add the missing TexEnv::current() function Use current() instead of the more complex invocation in Texture::update_parameter --- diff --git a/source/texenv.cpp b/source/texenv.cpp index 3730a7e1..703a8d0a 100644 --- a/source/texenv.cpp +++ b/source/texenv.cpp @@ -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)) diff --git a/source/texenv.h b/source/texenv.h index 01e4a556..55704e58 100644 --- a/source/texenv.h +++ b/source/texenv.h @@ -38,6 +38,7 @@ public: const Color &get_color() const { return color; } void bind() const; + static const TexEnv *current(); static void unbind(); }; diff --git a/source/texture.cpp b/source/texture.cpp index eca03347..dc69732f 100644 --- a/source/texture.cpp +++ b/source/texture.cpp @@ -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);