PDA

View Full Version : getting blank screen



marysowdha
11-06-2001, 12:41 PM
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

Screaming Lunatic
11-06-2001, 12:47 PM
Your polygon is wound clockwise. Meaning that it is backfacing.

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

SL

mikael_aronsson
11-06-2001, 02:51 PM
Hi !

Have you setup the projection matrix and modelview matrix correct ?

Mikael