Persistence of texture parameters

Posted by fen on Stack Overflow See other posts from Stack Overflow or by fen
Published on 2010-03-08T15:42:46Z Indexed on 2010/03/08 15:51 UTC
Read the original article Hit count: 286

Filed under:
|

I use glBindTexture() to bind a previously created texture. After the glBindTexture() call I use glTexParameteri() to set MIN and MAG filter. No problem so far.

Are those parameters I set using glTexParameteri() bound to the texture itself or are they lost if I bind another texture. Do i have to set them again?

glGenTexture(1, &tex1);
glGenTexture(1, &tex2);

/* bind tex1 and set params */
glBindtexture(GL_TEXTURE_RECTANGLE_ARB, tex1);
glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, ...);
glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

/* do something */

/* bind tex2 and set params */
glBindtexture(GL_TEXTURE_RECTANGLE_ARB, tex2);
glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, ...);
glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

/* do something */

/* bind tex1 again */
glBindtexture(GL_TEXTURE_RECTANGLE_ARB, tex1);

/* do i have to set the parameters from above again or are they stored with tex1? */

© Stack Overflow or respective owner

Related posts about opengl

Related posts about textures