X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexturing.cpp;h=093c602e917c2ec7bf3ee67a626eedb4f4e43ab4;hb=9bc72d268d1dd9dcf7c5f1f6b911ef97b54d81bd;hp=1c8410c57a6bff3ee9388805964a1cca0876981c;hpb=6fd9b09f47ff6a07bd5ca7f9e8887db3486bfcb1;p=libs%2Fgl.git diff --git a/source/texturing.cpp b/source/texturing.cpp index 1c8410c5..093c602e 100644 --- a/source/texturing.cpp +++ b/source/texturing.cpp @@ -1,4 +1,3 @@ -#include "texenv.h" #include "texture.h" #include "texturing.h" #include "texunit.h" @@ -16,20 +15,15 @@ Texturing::~Texturing() void Texturing::attach(unsigned attch, const Texture &tex) { - set_attachment(attch, &tex, 0); -} - -void Texturing::attach(unsigned attch, const Texture &tex, const TexEnv &env) -{ - set_attachment(attch, &tex, &env); + set_attachment(attch, &tex); } void Texturing::detach(unsigned attch) { - set_attachment(attch, 0, 0); + set_attachment(attch, 0); } -void Texturing::set_attachment(unsigned attch, const Texture *tex, const TexEnv *env) +void Texturing::set_attachment(unsigned attch, const Texture *tex) { if(attch>=TexUnit::get_n_units()) throw out_of_range("Texturing::set_attachment"); @@ -37,8 +31,7 @@ void Texturing::set_attachment(unsigned attch, const Texture *tex, const TexEnv if(attachments.size()<=attch) attachments.resize(attch+1); - attachments[attch].tex = tex; - attachments[attch].env = env; + attachments[attch] = tex; if(current()==this) bind_attachment(attch); @@ -46,21 +39,15 @@ void Texturing::set_attachment(unsigned attch, const Texture *tex, const TexEnv 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); - if(attch.env) - attch.env->bind_to(i); - else - TexEnv::unbind_from(i); } void Texturing::unbind_attachment(unsigned i) { Texture::unbind_from(i); - TexEnv::unbind_from(i); } void Texturing::bind() const @@ -88,11 +75,5 @@ void Texturing::unbind() } } - -Texturing::Attachment::Attachment(): - tex(0), - env(0) -{ } - } // namespace GL } // namespace Msp;