Jump to content

  • Log In with Google      Sign In   
  • Create Account

glActiveTexture and 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 arka80   Members   -  Reputation: 911

Like
0Likes
Like

Posted 26 January 2014 - 03:39 PM

I thought that a glBindTexture following a glActiveTexture would cause the texture to be binded in the texture order specified by the glActiveTexture, but according to my experiments it's not. 

 

Example:

glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texID);
// draw something using GL_TEXTURE0... it uses texture texID

glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, anotherTexID);
// draw something using GL_TEXTURE0 again... it uses anotherTexID!

texID is binded to GL_TEXTURE0 ? and anotherTexID to GL_TEXTURE1? I think not, because second draw will use the second texture even if I tell to use GL_TEXURE0 (the first).

 

So it's true? glBind is not related to glActive and viceversa?

 

 

 

 

 

 

 

 



Sponsor:

#2 mhagain   Crossbones+   -  Reputation: 7979

Like
1Likes
Like

Posted 26 January 2014 - 05:30 PM

This depends on what texture environment (via glTexEnv - for fixed pipeline OpenGL) or shader (for modern OpenGL) you've set.  In other words - glBindTexture does set the texture for the currently active texture unit, but this just sets the inputs for your drawing.  It's also up to you to tell OpenGL what to actually do with those inputs.


It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#3 arka80   Members   -  Reputation: 911

Like
0Likes
Like

Posted 27 January 2014 - 07:04 AM

thank for reply, I use shaders.

 

Anyway, this morning, after visual studio restart and a clean and rebuild (or maybe a night of sleep), it works as aspected, with the second call using the second texture. I hope this will never happens again! Yesterday I tried so many times! mah wacko.png






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