]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texturing.cpp
Make Animation::Iterator assignable
[libs/gl.git] / source / texturing.cpp
index db8ee65359a87993fe707fd0182bda4f210e1f51..dff3757fdb6d9b8985234e87241153d94b41a80b 100644 (file)
@@ -31,17 +31,21 @@ void Texturing::set_attachment(unsigned attch, const Texture *tex)
        if(attachments.size()<=attch)
                attachments.resize(attch+1);
 
-       attachments[attch].tex = tex;
+       attachments[attch] = tex;
 
        if(current()==this)
                bind_attachment(attch);
 }
 
+const Texture *Texturing::get_attached_texture(unsigned i) const
+{
+       return i<attachments.size() ? attachments[i] : 0;
+}
+
 void Texturing::bind_attachment(unsigned i) const
 {
-       const Attachment &attch = attachments[i];
-       if(attch.tex)
-               attch.tex->bind_to(i);
+       if(const Texture *tex = attachments[i])
+               tex->bind_to(i);
        else
                Texture::unbind_from(i);
 }
@@ -76,10 +80,5 @@ void Texturing::unbind()
        }
 }
 
-
-Texturing::Attachment::Attachment():
-       tex(0)
-{ }
-
 } // namespace GL
 } // namespace Msp;