shutting down multitex & combine_ext

hi!

ok, I have set up my multitex renderer, but do not know how to shut it down (so the other triangles of the scene do not get multitexed).

I’m using the following code to initialize multitex + combine_ext:

glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
usetexture(12);
glTexEnviGL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_REPLACE);

// layer 2: modulate incoming color+texture
glActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
usetexture(11);

glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_MODULATE);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_PREVIOUS_EXT);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR);
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_TEXTURE);
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR);

And right now I use the following shutdown code (which does not shut the damn thing down, and all triangles appear multitexed).

glActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);

glActiveTextureARB(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D);

What am I doing wrong?

thanx,

dani

At the end of this code, the active texture unit is unit #1. This may be the problem …

perfect… i tried it and works perfect.
You guys rule

Originally posted by paddy:
At the end of this code, the active texture unit is unit #1. This may be the problem …