]> git.tdb.fi Git - libs/gl.git/commitdiff
Replace Texturing::Attachment with a simple Texture pointer
authorMikko Rasa <tdb@tdb.fi>
Fri, 17 Oct 2014 21:14:27 +0000 (00:14 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 17 Oct 2014 21:14:27 +0000 (00:14 +0300)
No point to have the struct now that TexEnv is gone.

source/texturing.cpp
source/texturing.h

index db8ee65359a87993fe707fd0182bda4f210e1f51..093c602e917c2ec7bf3ee67a626eedb4f4e43ab4 100644 (file)
@@ -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;
index daeb2bb812d7bfe62331951070a9fb4977d18490..34141c64136fb4d4d0dac7dfbdc90e76cbad6ba0 100644 (file)
@@ -12,14 +12,7 @@ class Texture;
 class Texturing: public Bindable<Texturing>
 {
 private:
-       struct Attachment
-       {
-               const Texture *tex;
-
-               Attachment();
-       };
-
-       std::vector<Attachment> attachments;
+       std::vector<const Texture *> attachments;
 
 public:
        ~Texturing();