Jump to content
  • Advertisement
Sign in to follow this  
johdex

Texture functions and texture objects

This topic is 4158 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

Hi, From the Red Book, I had the impression that the texture function provided using glTexEnv was part of the "state" of a texture object. But the following code changes the function of texture object 2 even though it has not yet glBindTextur-ed (which happens in font->begin())
  GLint tex;
  glGetIntegerv(GL_TEXTURE_BINDING_2D, &tex);
  assert(tex != 2);

  glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);

  font->begin();
Isn't that wrong???

Share this post


Link to post
Share on other sites
Advertisement
This is correct, glTexEnv is not configured per texture object but per texture stage. Because it is able to configure the combination of multiple textures, it can not be logically bound to one texture.
Only the calls to glTexParameter are saved in the texture object because they refer only to one texture.
The calls to glTexParameter and glTexEnv also refer to other parts of the pipeline. For example, the settings of glTexEnv are completely replaced by a fragment shader.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!