Jump to content
  • Advertisement
Sign in to follow this  

OpenGL Color

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

In OpenGL, Say i draw a quad with glBegin(GL_QUADS) but before i do i set the colour with glColor4f(r,g,b,a) how would i RESET the glColour back to normal, so everything else is affected by the colours i set. I've done some looking aroung and all i can find is that all you can do is initialize another colour, but no way of actually reseting it? I ask because i have a 3ds model loaded in, and im drawing a quad or triangle

Share this post


Link to post
Share on other sites
Advertisement
There is always a colour set - so theres no way (or concept) of 'resetting' it.

By default textures are modulated (multiplied) by the vertex colour. If you just want your textures to be unaffected by the current colour then setting the colour to white (glColor4f(1, 1, 1, 1)) should do it.

Share this post


Link to post
Share on other sites
Like orangytang said, there is always a color set. When you use glColor4f, you are setting the color set to a different color. It starts out as white, so if you want to change it back to white, just use glColor4f(1.0f, 1.0f, 1.0f, 1.0f);

Share this post


Link to post
Share on other sites
Not sure what you're asking, but...


// Store current color, and lots of other stuff
glPushAttrib(GL_CURRENT_BIT);

glColor3f(1.0, 0.0, 0.0);
//Draw red things...

// Restore the original color
glPopAttrib();

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!