- for(vector<TextureSlot>::iterator i=textures.begin(); i!=textures.end(); ++i)
- if(i->index==index)
- {
- i->texture = tex;
- i->texture.keep();
- return;
- }
-
- throw KeyError("No texture slot for that unit", lexical_cast(index));
-}
-
-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();