Trouble with Textures and Materials

I am just having a quick problem with lighting. When I put in

glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT_AND_BACK,
GL_AMBIENT_AND_DIFFUSE);

my materials render right but my textures don’t.

when I take the code out, my textures render
but my materials are gray to white depending on the ambient values of my light.

How can I have my materials show through and my textures render correctly?

Hey there!

Try this:
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);

Here’s what this call does:
final color = texel color * lit polygon color

Hope that helps

Regards,
David