X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Ftexturing.cpp;h=dff3757fdb6d9b8985234e87241153d94b41a80b;hp=db8ee65359a87993fe707fd0182bda4f210e1f51;hb=4b4d2a48048268d2ad48bafbce8647af8088573f;hpb=f1b12c992db974c679d85ae6ec22cd318199d0d5 diff --git a/source/texturing.cpp b/source/texturing.cpp index db8ee653..dff3757f 100644 --- a/source/texturing.cpp +++ b/source/texturing.cpp @@ -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 ibind_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;