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

Texture functions and texture objects

Started by johdex Feb 1, 2007 at 3:51 PM 0 replies 750+ views
Original Post
johdex
johdex
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???
-- Top10 Racing Simulation needs more developers!http://www.top10-racing.org
Yonibear
Yonibear
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.

Topic Locked

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

Sign in to reply to this topic.