Jump to content

  • Log In with Google      Sign In   
  • Create Account

A little clarification on glBindTexture


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 CDProp   Members   -  Reputation: 1046

Like
0Likes
Like

Posted 05 January 2013 - 04:04 PM

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.



Sponsor:

#2 __SKYe   Members   -  Reputation: 1096

Like
2Likes
Like

Posted 05 January 2013 - 05:29 PM

Go here for an explanation http://www.opengl.org/discussion_boards/showthread.php/174926-when-to-use-glActiveTexture



#3 CDProp   Members   -  Reputation: 1046

Like
0Likes
Like

Posted 05 January 2013 - 05:35 PM

That was quite helpful, thanks!






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS