Jump to content
  • Advertisement
Sign in to follow this  
mriz

Drawing Color Same as Texture

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

Hi, My drawing color is same as texture-primitive (over which it is drawn) color. I have changed color after texture drawing but it doesn't change. Can anybody plz help regarding this?

Share this post


Link to post
Share on other sites
Advertisement
Well, some progress... In NeHe Lesson 06 (Texture Mapping), I've drawn Rectangle after Texture drawing, The rectangle is drawn of the same coloras texture. Even after changing the rectangle color color does not change. I've tried many combinations SO
I'm after a way to load texture image and draw any primitive BUT of different colors i.e. texture image's and say quad of different colors.

Thanks

Share this post


Link to post
Share on other sites
It sounds to me like you're looking to use the Material colors stuff.

After a quick look around, it seems like you need to do...
glEnable( GL_COLOR_MATERIAL );
glColorMaterial( GL_FRONT, GL_AMBIENT_AND_DIFFUSE );

...in order to use glColorxx to color textures.

You can also use:
float colorBlue[] = { 0.0f, 0.0f, 1.0f, 1.0f };
glMaterialv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, colorBlue );


I got this info from: http://www.falloutsoftware.com/tutorials/gl/gl8.htm

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!