PDA

View Full Version : glTexParameter - where does it bind to?


Fenris
2003.09.25, 04:41 AM
Am I right assuming that a call to glTexParameteri binds to the currently bound texture object, or does it change any global state?

I'd like to filter some of my textures with another filter than others - it should be OK to call glTexParameteri for each texture object, right? The Red Book was a little blurry on this. :/

OneSadCookie
2003.09.25, 06:04 AM
It affects the currently bound texture only, no global state.

Mars_999
2003.09.26, 12:29 AM
Originally posted by Fenris
Am I right assuming that a call to glTexParameteri binds to the currently bound texture object, or does it change any global state?

I'd like to filter some of my textures with another filter than others - it should be OK to call glTexParameteri for each texture object, right? The Red Book was a little blurry on this. :/

You should really call glTexParameteri() on all your textures unless you want the default texture parameters used. That way you eliminate any confusion to what parameters the texture is using.

OneSadCookie
2003.09.26, 06:43 AM
Potential cross-platform gotcha: TEXTURE_MIN_FILTER is supposed to default to NEAREST_MIPMAP_LINEAR, which results in a white image drawn if you don't build the mipmap levels.

Unfortunately (or fortunately if you want to look at it that way), it defaults to LINEAR on the Mac. This can lead to some very annoying bugs when porting to more correct platforms (such as Windows and Linux).

Fenris
2003.09.26, 07:55 AM
That is really good to know, Keith... where the heck do you dig up stuff like that? :)

Thanks for your replies, by the way!