Skip to main content
GameDev.net gamedev.net
🔒 Locked

A little clarification on glBindTexture

Started by CDProp Jan 5, 2013 at 10:04 PM 1 replies 1.3k views
Original Post
CDProp
CDProp

When first creating a texture, I will want to of course use glBindTexture in order to set up the texture storage and parameters. However, at this point there are no plans to actually sample from the texture. My question is, in calling glBindTexture, aren't I also changing the binding for whichever texture image unit is active (unit 0 by default, or whatever was set through the last call to glActiveTexture), i.e. the GL_TEXTURE_BINDING_* state?

And if so, doesn't that mean that I should push/pop that state while creating my new texture?

I admit it probably doesn't matter all that much, since texture creation usually happens at a different stage than texture sampling (initialization stage vs. rendering stage), but it seems like a lot of tutorials gloss over this, calling glBindTexture without even being concerned about which texture image unit is active.

CDProp
CDProp

That was quite helpful, thanks!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.