throw out_of_range("TexUnit::activate");
if(units.size()<=n)
+ {
+ unsigned i = units.size();
units.resize(n+1);
+ for(; i<units.size(); ++i)
+ units[i].index = i;
+ }
if(cur_unit!=&units[n] && (cur_unit || n))
glActiveTexture(GL_TEXTURE0+n);
class TexUnit
{
private:
+ unsigned index;
const Texture *texture;
const TexEnv *texenv;
const TexGen *texgen[4];
public:
TexUnit();
+ unsigned get_index() const { return index; }
bool set_texture(const Texture *);
const Texture *get_texture() const { return texture; }
bool set_texenv(const TexEnv *);