PDA

View Full Version : Loaded texture parameters?



LostInTheWoods
05-13-2004, 04:30 AM
If I load a 2D texture with these parameters.
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

Then later on in the code I wish to change to these parameters for the same texture.
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

Is that a valid call, and will it actualy change the rendering of that texture? Or will the first values always be used?

brcain
05-13-2004, 05:19 AM
Just be sure to bind (make active) the texture that you want to change the parameter for.

DrawCb()
{
...
glBindTexture(GL_TEXTURE_2D, textureName);
if(usingLinear == true))
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
else
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
...
}