How to turn on/off light between 2D and 3D object

I write some source codes to draw using OpenGL.
Some entitis are 2D, others are 3D. Here is my sample codes:

//initial, light is on.

glDisable(GL_LIGHTING);

draw 2d entities.

glEnable(GL_LIGHTING);


draw 3d entites.

I found there is not shading on 3D entities, why? Could anyone give me some suggestions?

Moving to the beginners forum.

– Tom