- if(last_applied && this!=last_applied)
- {
- vector<BoundTexture>::const_iterator i = textures.begin();
- vector<BoundTexture>::const_iterator j = last_applied->textures.begin();
- while(j!=last_applied->textures.end())
- {
- if(i==textures.end() || j->binding<i->binding)
- {
- if(bound_tex_targets[j->binding])
- {
- if(ARB_direct_state_access)
- glBindTextureUnit(j->binding, 0);
- else
- {
- glActiveTexture(GL_TEXTURE0+j->binding);
- glBindTexture(bound_tex_targets[j->binding], 0);
- }
- }
- ++j;
- }
- else
- {
- if(i->binding==j->binding)
- ++j;
- ++i;
- }
- }
- }
-
- for(vector<BoundTexture>::const_iterator i=textures.begin(); i!=textures.end(); ++i)
- if(i->changed || mask==~0U)