Skip to main content
gamedev.net
🔒 Locked

Problem regarding glTexEnvi() function

Started by skyline 2 replies 400+ views
Original Post
skyline
skyline
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); ...
skyline
skyline
skyline
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,


skyline
zedzeek
zedzeek
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

Topic Locked

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

Sign in to reply to this topic.