From: Mikko Rasa Date: Fri, 17 Oct 2014 21:14:27 +0000 (+0300) Subject: Replace Texturing::Attachment with a simple Texture pointer X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=c8f98daaaba04ba93d6d7170302d8b91c3410fa5;p=libs%2Fgl.git Replace Texturing::Attachment with a simple Texture pointer No point to have the struct now that TexEnv is gone. --- diff --git a/source/texturing.cpp b/source/texturing.cpp index db8ee653..093c602e 100644 --- a/source/texturing.cpp +++ b/source/texturing.cpp @@ -31,7 +31,7 @@ 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); @@ -39,9 +39,8 @@ void Texturing::set_attachment(unsigned attch, const Texture *tex) 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 +75,5 @@ void Texturing::unbind() } } - -Texturing::Attachment::Attachment(): - tex(0) -{ } - } // namespace GL } // namespace Msp; diff --git a/source/texturing.h b/source/texturing.h index daeb2bb8..34141c64 100644 --- a/source/texturing.h +++ b/source/texturing.h @@ -12,14 +12,7 @@ class Texture; class Texturing: public Bindable { private: - struct Attachment - { - const Texture *tex; - - Attachment(); - }; - - std::vector attachments; + std::vector attachments; public: ~Texturing();