glcolor4f and lighting_enabled
Hello,
I am trying to write a custom jit.gl object. In my drawing function I draw a rectangle as follows:
t_jit_err jit_gl_simple_draw(t_jit_gl_simple *x)
{
t_jit_err result = JIT_ERR_NONE;
glBegin(GL_QUADS);
glColor4f(0.5, 0.3, 0.7, 0.2);
glVertex3f(-1,-1,0);
glColor4f(0.5, 0.3, 0.2, 0.2);
glVertex3f(-1,1,0);
glColor4f(0.5, 0.1, 0.2, 0.2);
glVertex3f(1,1,0);
glColor4f(0.2, 0.1, 0.2, 0.2);
glVertex3f(1,-1,0);
glEnd();
return result;
}
If I have lighting_enabled set to 0, I'll see the color. But when lighting_enabled set to 1, it turns into grayscale. Does anyone know what I am missing? Any advices would be very appreciated!
cheers,
mf
found solution already :D
need to have glEnable(GL_COLOR_MATERIAL) in the drawing function