if(manager)
manager->resource_used(*this);
- unit.bind();
- if(unit.supports_legacy())
+ if(ARB_direct_state_access && !unit.supports_legacy())
+ glBindTextureUnit(i, id);
+ else
{
- if(old && old->target!=target)
- glDisable(old->target);
- if(!old || old->target!=target)
- glEnable(target);
+ unit.bind();
+ if(unit.supports_legacy())
+ {
+ if(old && old->target!=target)
+ glDisable(old->target);
+ if((!old || old->target!=target))
+ glEnable(target);
+ }
+ glBindTexture(target, id);
}
- glBindTexture(target, id);
if(dirty_params)
{
const Texture *cur = unit.get_texture();
if(unit.set_texture(0))
{
- unit.bind();
- glBindTexture(cur->target, 0);
- if(unit.supports_legacy())
- glDisable(cur->target);
+ if(ARB_direct_state_access && !unit.supports_legacy())
+ glBindTextureUnit(i, 0);
+ else
+ {
+ unit.bind();
+ glBindTexture(cur->target, 0);
+ if(unit.supports_legacy())
+ glDisable(cur->target);
+ }
}
}