• Advertisement
Sign in to follow this  

A little clarification on glBindTexture

This topic is 1842 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement