12 const TexEnv &TexEnv::default_object()
18 void TexEnv::update_parameter(int mask) const
20 if(TexUnit::current().get_texenv()!=this)
22 TexUnit *unit = TexUnit::find_unit(this);
30 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, mode);
32 glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, &color.r);
35 void TexEnv::set_mode(TexEnvMode m)
38 update_parameter(MODE);
41 void TexEnv::set_color(const Color &c)
44 update_parameter(COLOR);
47 void TexEnv::bind_to(unsigned i) const
49 TexUnit &unit = TexUnit::get_unit(i);
50 if(unit.set_texenv(this))
57 const TexEnv *TexEnv::current(unsigned i)
59 return TexUnit::get_unit(i).get_texenv();
62 void TexEnv::unbind_from(unsigned i)
64 default_object().bind_to(i);