PDA

View Full Version : Texture State Problem



BigDave
07-01-2009, 05:26 AM
Hi,

(EDIT - Forgot to add - this is openGL-ES)

I'm having a problem with texture states remaining, even when they have been set to something else.

if I set:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);

(for mip-mapping)

then set

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

I would expect it to remain indefinitely as GL_LINEAR for the min filter. Yet, at a later state in the program, calling glBindTexture on another texture sets the min filter back to GL_LINEAR_MIPMAP_NEAREST.

I even get the texture state prior to glBindTexture and it is set to Linear, and get the texture state after glBindTexture to find it has been set to linear_mipmap_nearest.

This has me stumped! Any help / advice would be appreciated

David

skynet
07-01-2009, 05:50 AM
The filter settings are per-texture state. Each texture can have its own filter setting. Switching to another texture with glBindTexture() will also cause glGetTexParameteri() to return the state of that other texture.