X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Ftexturing.cpp;h=77bb15435c7391a62a0298ea653f6699417eb55f;hp=093c602e917c2ec7bf3ee67a626eedb4f4e43ab4;hb=553f3ec4fbe28a37978ee53b9b6e22fedb691e1d;hpb=c8f98daaaba04ba93d6d7170302d8b91c3410fa5 diff --git a/source/texturing.cpp b/source/texturing.cpp index 093c602e..77bb1543 100644 --- a/source/texturing.cpp +++ b/source/texturing.cpp @@ -7,6 +7,8 @@ using namespace std; namespace Msp { namespace GL { +bool Texturing::legacy_used = true; + Texturing::~Texturing() { if(current()==this) @@ -34,13 +36,18 @@ void Texturing::set_attachment(unsigned attch, const Texture *tex) attachments[attch] = tex; if(current()==this) - bind_attachment(attch); + bind_attachment(attch, legacy_used); +} + +const Texture *Texturing::get_attached_texture(unsigned i) const +{ + return ibind_to(i); + tex->bind_to(i, legacy); else Texture::unbind_from(i); } @@ -50,13 +57,14 @@ void Texturing::unbind_attachment(unsigned i) Texture::unbind_from(i); } -void Texturing::bind() const +void Texturing::bind(bool legacy) const { const Texturing *old = current(); - if(set_current(this)) + if(set_current(this) || legacy!=legacy_used) { + legacy_used = legacy; for(unsigned i=0; iattachments.size(); ++i)