After you set filters with glTexParameteri
for the binded texture object, then that texture object will always be rendered with that filter until you set the filters again to some other value. So, if you want to test the different filters just to see how they do, then you could do:
glBindTexture(GL_TEXTURE_2D, texture[0]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glBegin(GL_QUADS);
// .. render something..
glEnd();
// ..
glBindTexture(GL_TEXTURE_2D, texture[0]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glBegin(GL_QUADS);
// .. render something ..
glEnd();
It is just a matter of binding the texture, and applying a different set of filters for the different objects you render. You might not see this kind of code very often because people tend to apply just one type of filter to one texture, but it is possible to alternate the filtering like in the above.
and then do
texture[1] = texture[0]
, does what i did before go intotexture[1]
aswell?
Yes. The texture ID is nothing more than an address or pointer to the texture object, so, doing texture[1] = texture[0]
doesn't create a new object just like copying a pointer doesn't copy the object that they point to, it just makes them both point to the same object. So, texture[1]
and texture[0]
will simply represent the exact same texture all the time, whatever you do to one, you do to the other.
You have to understand that the whole point of all this is that the texture itself (the image) is transferred …