PDA

View Full Version : glLight is making my scene go black and white!!



02-15-2003, 06:32 AM
AArgh! Sorry this is driving me insane! Here is the code I have in my program, I'm trying to get just basic lightsourcing working:

void DoLighting()
{
// Set the shading model
glShadeModel(GL_FLAT);

glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);

GLint Sun[4] = {0,15,0,1};

glEnable(GL_LIGHTING);

glLightiv(GL_LIGHT0, GL_POSITION, Sun);

glEnable(GL_LIGHT0);

}


Anyway, it all works fine, the lightsourcing looks correct and everything, it just comes out in B&W instead of colour... Is there somethign I'm missing?

DFrey
02-15-2003, 09:42 AM
Did you enable color materials?