]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texturing.cpp
Remove support for legacy OpenGL features
[libs/gl.git] / source / texturing.cpp
index 77bb15435c7391a62a0298ea653f6699417eb55f..dff3757fdb6d9b8985234e87241153d94b41a80b 100644 (file)
@@ -7,8 +7,6 @@ using namespace std;
 namespace Msp {
 namespace GL {
 
-bool Texturing::legacy_used = true;
-
 Texturing::~Texturing()
 {
        if(current()==this)
@@ -36,7 +34,7 @@ void Texturing::set_attachment(unsigned attch, const Texture *tex)
        attachments[attch] = tex;
 
        if(current()==this)
-               bind_attachment(attch, legacy_used);
+               bind_attachment(attch);
 }
 
 const Texture *Texturing::get_attached_texture(unsigned i) const
@@ -44,10 +42,10 @@ const Texture *Texturing::get_attached_texture(unsigned i) const
        return i<attachments.size() ? attachments[i] : 0;
 }
 
-void Texturing::bind_attachment(unsigned i, bool legacy) const
+void Texturing::bind_attachment(unsigned i) const
 {
        if(const Texture *tex = attachments[i])
-               tex->bind_to(i, legacy);
+               tex->bind_to(i);
        else
                Texture::unbind_from(i);
 }
@@ -57,14 +55,13 @@ void Texturing::unbind_attachment(unsigned i)
        Texture::unbind_from(i);
 }
 
-void Texturing::bind(bool legacy) const
+void Texturing::bind() const
 {
        const Texturing *old = current();
-       if(set_current(this) || legacy!=legacy_used)
+       if(set_current(this))
        {
-               legacy_used = legacy;
                for(unsigned i=0; i<attachments.size(); ++i)
-                       bind_attachment(i, legacy);
+                       bind_attachment(i);
                if(old)
                {
                        for(unsigned i=attachments.size(); i<old->attachments.size(); ++i)