X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture.cpp;h=381a0a59d6eaed1453fa965b6e9062ba7233dcec;hb=85d077813b5337e78d91e637177abebf37dd0425;hp=ab5700482ce02484efb7b960df00a9b3a95a0908;hpb=635e5dc39adf09051bdacadbc402ddf22f7807a3;p=libs%2Fgl.git diff --git a/source/texture.cpp b/source/texture.cpp index ab570048..381a0a59 100644 --- a/source/texture.cpp +++ b/source/texture.cpp @@ -238,7 +238,8 @@ void Texture::bind_to(unsigned i) const glBindTexture(target, id); } - default_sampler.bind_to(i); + if(!unit.get_sampler()) + default_sampler.bind_to(i); } } @@ -260,6 +261,9 @@ void Texture::unbind_from(unsigned i) unit.bind(); glBindTexture(cur->target, 0); } + + if(unit.get_sampler()==&cur->default_sampler) + Sampler::unbind_from(i); } }