problem in show square's color in my code

hello, i wrote a code that show 4 squares with rotates around a point with Different speed. But while running the code, the squares’ color isn’t show well. please help me.very thanks.
Code:

#include <cstdlib>
#include <GL/glut.h>

static float ypoz = 0, zpoz = 0 , qpoz=0 , tpoz=0 , wpoz=0 , apoz=0 , xpoz=0 , rpoz=0 ;

void init(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glMatrixMode(GL_PROJECTION);
gluOrtho2D (100, 100, 0, 200);
glShadeModel (GL_SMOOTH);
glEnable(GL_DEPTH_TEST);
}

void display(void)
{

glLoadIdentity ();
glTranslatef(0,0,-6);
glRotatef(ypoz,0,0,1);
glRotatef(zpoz,0,1,0);
glColor3f (1, 0,0);
glBegin (GL_QUADS);
glVertex2f (-0.8, 0);
glVertex2f (-0.4, 0.4);
glVertex2f (0.0, 0.0);
glVertex2f (-0.4, -0.4);
glEnd ();
glutSwapBuffers();

glLoadIdentity ();
glTranslatef(0,0,-6);
glRotatef(qpoz,0,0,1);
glRotatef(tpoz,0,1,0);
glColor3f (0, 1,0);
glBegin (GL_QUADS);
glVertex2f (-0.8, 0);
glVertex2f (-0.4, 0.4);
glVertex2f (0.0, 0.0);
glVertex2f (-0.4, -0.4);
glEnd ();
glutSwapBuffers();

glLoadIdentity ();
glTranslatef(0,0,-6);
glRotatef(wpoz,0,0,1);
glRotatef(apoz,0,1,0);
glColor3f (0, 0,1);
glBegin (GL_QUADS);
glVertex2f (-0.8, 0);
glVertex2f (-0.4, 0.4);
glVertex2f (0.0, 0.0);
glVertex2f (-0.4, -0.4);
glEnd ();
glutSwapBuffers();

glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity ();
glTranslatef(0,0,-6);
glRotatef(xpoz,0,0,1);
glRotatef(rpoz,0,1,0);
glColor3f (1, 1,1);
glBegin (GL_QUADS);
glVertex2f (-0.8, 0);
glVertex2f (-0.4, 0.4);
glVertex2f (0.0, 0.0);
glVertex2f (-0.4, -0.4);
glEnd ();
glFlush ();
}

void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
gluPerspective(30.0, (GLfloat) w/(GLfloat) h, 1.0, 20.0);
glMatrixMode (GL_MODELVIEW);
}

void keyboard(unsigned char key, int x, int y)
{
switch (key) {
case 27: // ESC key
exit(0);
break;
}
}

void animate()
{
ypoz=ypoz+1;
if (ypoz>360) ypoz=0;

qpoz=qpoz+0.75;
if (qpoz>270) qpoz=0;

wpoz=wpoz+0.5;
if (wpoz>180) wpoz=0;

xpoz=xpoz+0.25;
if (xpoz>90) xpoz=0;
glutPostRedisplay();
}

int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
glutInitWindowSize (700, 500);
glutInitWindowPosition (300, 100);
glutCreateWindow (argv[0]);
init ();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard);
glutIdleFunc(animate);
glutMainLoop();
return 0;
}