How to sample the same texture using different filter mode?

Hello, I’m quite new to opengl, and I would like to know is there a way to sample the same texture using different filter mode. I’m currently using glTexParameteri to specify filter mode. But it seems like that filter mode is property of a texture, not a sampler, thus this piece of code does not behave like I’d expect:
glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_2D, 1);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glActiveTextureARB(GL_TEXTURE1_ARB);
glBindTexture(GL_TEXTURE_2D, 1);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);

seems like the last call to glTexParameteri overwrites filter mode for the GL_TEXTURE0_ARB texture stage.

Thanks,
Sergey.

glTexParameter is per texture object state.
You need to specify it once on texture object initialization and following glBindTexture calls will set it automatically.

In your case, as usual, OpenGL’s state machine keeps the last glTexParameter change at your texture object 1. Following rendering will use that mode for that object.

What you want needs two distinct texture objects with the same texture image but different texture parameters.