- textures[get_texture_index(slot)] = tex;
-}
-
-void RenderPass::bind() const
-{
- const RenderPass *old = current();
- if(!set_current(this))
- return;
-
- if(shprog)
- {
- shprog->bind();
- shdata->apply();
- }
- else if(old && old->shprog)
- GL::Program::unbind();
-
- if(material)
- material->bind();
- else if(old && old->material)
- GL::Material::unbind();
-
- for(unsigned i=0; i<textures.size(); ++i)
- if(textures[i].texture)
- textures[i].texture->bind_to(i);
- if(old)
- {
- for(unsigned i=textures.size(); i<old->textures.size(); ++i)
- GL::Texture::unbind_from(i);
- }
-}
-
-void RenderPass::unbind()
-{
- const RenderPass *old = current();
- if(!set_current(0))
- return;
-
- if(old->shprog)
- GL::Program::unbind();
-
- if(old->material)
- GL::Material::unbind();
-
- for(unsigned i=old->textures.size(); i--; )
- GL::Texture::unbind_from(i);