5 #include "version_1_3.h"
12 vector<TexUnit> TexUnit::units;
13 TexUnit *TexUnit::cur_unit = 0;
20 bool TexUnit::set_texture(const Texture *tex)
22 bool result = (tex!=texture);
27 bool TexUnit::set_texenv(const TexEnv *env)
29 bool result = (texenv!=env);
34 unsigned TexUnit::get_n_units()
36 static int count = -1;
39 if(is_version_at_least(2, 0) || is_supported("ARB_vertex_shader"))
40 glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &count);
41 else if(is_version_at_least(1, 3))
42 glGetIntegerv(GL_MAX_TEXTURE_UNITS, &count);
49 TexUnit &TexUnit::activate(unsigned n)
52 throw out_of_range("TexUnit::activate");
57 if(cur_unit!=&units[n] && (cur_unit || n))
58 glActiveTexture(GL_TEXTURE0+n);
64 TexUnit &TexUnit::current()