Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

skyline

Problem regarding glTexEnvi() function

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

Dear friends, Let me directly to the point. When I used the above function with the third parameter as GL_DECAL, then everytime when I used a glColor() function, it didn''t work. The color in effect actually was from the texture ( i think so). Thank you in advance. By the way , the following is extracted from my source code: ... glBindTexture(GL_TEXTURE_2D, texture[loop]); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); ... // enable color tracking glEnable(GL_COLOR_MATERIAL); // Set material properites to follow glColor values glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE); ...

Share this post


Link to post
Share on other sites
Advertisement
Dear friends,

GL_MODULATE somewhat solved the problem. But the real problem
still remains which is that if you still use the GL_DECAL, your
glColor function may be void.

My finding is that I have to disable the texture when I draw
other objects. Something like the following:

<-------- begin -----

load the texture.
enable the texture attributes
...

draw object (with texture )
...

glDisable(GL_TEXTURE_2D);
draw other objects ( with no texture needed)
glEnable(GL_TEXTURE_2D);


<------ end ----

zedzeek, thanks for your reply.


Regards,


Share this post


Link to post
Share on other sites
i dont really understand the question.
opengl is a state machine so perhaps set the colour to (1,1,1,1) after u disable the texturing

http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!