getting blank screen

Hi
I am trying to run a simple program
I have gl.h,glut.h,glu.h [compiler]\include\gl
Opengl32.lib,glut32.lib,glu32.lib [compiler]\lib
Opengl32.dll,glut32.dll,glu32.dll [system]

I save my source code in C:\Program Files\Microsoft Visual Studio\MyProjects.

It is displaying an empty window.

The source code
#include<GL\glut.h>

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();
}

int main(int argc, char** argv)
{
glutInit(&argc,argv);
glutCreateWindow(“simple”);
glutDisplayFunc(display);
glutMainLoop();

}

Please help me in solving this issue.
Mary

Your polygon is wound clockwise. Meaning that it is backfacing.

Wind your vertices the other way and you’ll see your polygon.

SL

Hi !

Have you setup the projection matrix and modelview matrix correct ?

Mikael