No point to have the struct now that TexEnv is gone.
if(attachments.size()<=attch)
attachments.resize(attch+1);
- attachments[attch].tex = tex;
+ attachments[attch] = tex;
if(current()==this)
bind_attachment(attch);
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);
}
}
}
-
-Texturing::Attachment::Attachment():
- tex(0)
-{ }
-
} // namespace GL
} // namespace Msp;
class Texturing: public Bindable<Texturing>
{
private:
- struct Attachment
- {
- const Texture *tex;
-
- Attachment();
- };
-
- std::vector<Attachment> attachments;
+ std::vector<const Texture *> attachments;
public:
~Texturing();