Jump to content
  • Advertisement
Sign in to follow this  
Astrof

OpenGL Noob question: glColor and textures, etc

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

Ok, so I'm just starting with OpenGL (technically SDL and OpenGL), and I was using the NeHe tutorials, and I was wondering, is there a way to "reset" the current color? IE i want to tint a texture, but only that texture. I want it to go back to no color, is there a way to do that? I was thinking maybe changing the color to (0,0,0,0) or something.

Share this post


Link to post
Share on other sites
Advertisement
I tried it around my code block, still didn't work. how does pushMatrix work? does it work with glColor?

Share this post


Link to post
Share on other sites
Hmm, but all i'm doing is changing the color, I want to know how to undo the color. I just tried setting the color to (1,1,1,1) and it worked, but was wondering if there was a better way to do that.

Share this post


Link to post
Share on other sites
Pushing and popping the matrix does not save anything but the current matrix (hence the name PushMatrix() PopMatrix()). You will have to set the color back to not be tinted on your own.

Share this post


Link to post
Share on other sites
You can't really disable coloring of a polygon, with standard (fixed) pipeline final fragment (in simplification a pixel) color is based on both current color state (that is set by glColor) and (among many others) currend bound textures. So to cover a trangle with exact texture pattern, you either have to set current color to full white which is 4 x 1.0f with glColor4f or change the way in which texture texels are placed on triangle to GL_REPLACE using glTexEnv. glPush/PopMatrix functions have nothing to do with colors.

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.

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!