- set_array(GL_VERTEX_ARRAY, found&1, 1);
- set_array(GL_NORMAL_ARRAY, found&2, 2);
- set_array(GL_TEXTURE_COORD_ARRAY, found&4, 4);
- set_array(GL_COLOR_ARRAY, found&8, 8);
+ for(unsigned i=0; i<64; ++i)
+ if(enabled_arrays.is_set(i) && !found.is_set(i))
+ {
+ if(i==get_component_type(VERTEX3))
+ glDisableClientState(GL_VERTEX_ARRAY);
+ else if(i==get_component_type(NORMAL3))
+ glDisableClientState(GL_NORMAL_ARRAY);
+ else if(i==get_component_type(COLOR4_FLOAT))
+ glDisableClientState(GL_COLOR_ARRAY);
+ else if(i>=get_component_type(TEXCOORD1) && i<=get_component_type(TEXCOORD1)+3)
+ {
+ unsigned j = i-get_component_type(TEXCOORD1);
+ if(j>0 || active_tex)
+ glClientActiveTexture(GL_TEXTURE0+j);
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ active_tex = j;
+ }
+ else if(i<get_component_type(ATTRIB1))
+ glDisableVertexAttribArray(i);
+ else
+ glDisableVertexAttribArray(i-get_component_type(ATTRIB1));
+ }