PDA

View Full Version : Simple problem



Joshhua5
01-04-2011, 05:14 AM
I don't know what the problem is... So here's the code


#include <stdlib.h>
#include <gl\glut.h>
#include <gl\GL.h>

void glCross (void)
{
glClearColor(1, 1, 1, 1);
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POLYGON);
glColor3f(0, 1, 0);
glVertex2f(0.0, 200.0);
glVertex2f(400.0, 200.0);
glVertex2f(200.0, 0.0);
glVertex2f(200.0, 400.0);
glEnd();

glFlush();
}

void main(int argc, char **argv)
{
glutInit(&amp;argc, argv);
glutInitWindowPosition(500,500);
glutInitWindowSize(800,600);
glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);
glutCreateWindow("Cross");
glutDisplayFunc(glCross);
glutMainLoop();
}

Joshhua5
01-04-2011, 05:30 AM
Solven... i failed with the Vertex positioning.