getting blank screen

Hi SL
I have changed my vertices to CCW as follows, then also It is not getting displayed

void display()
{

glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POLYGON);
glVertex2f(-0.5,-0.5);
glVertex2f(0.5,-0.5);
glVertex2f(0.5,0.5);
glVertex2f(-0.5,0.5);

glEnd();
glFlush();

}

Again you need to swapbuffers appropriately for your target system even without glut. The alternative is to use single buffered rendering.

By the way … a normal could be useful too

You assume lighting.
Perhaps a color would be a better investment.