#include <GL/glut.h>

void display()
{
	glClear(GL_COLOR_BUFFER_BIT);

	glBegin(GL_QUADS);
	glColor3f(1,1,1);
	glVertex3f(0,0,0);
	glVertex3f(128,0,0);
	glVertex3f(128,128,0);
	glVertex3f(0,128,0);
	glEnd();
	
	glutSwapBuffers();
}

void reshape(int w, int h)
{
	glViewport(0,0,w,h);
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();	
	/*
	gluPerspective(60, 		// field of view
		       double(w)/h , 	// aspect ratio
		       .1, 		// near clip plane
			100);		// far clip plane
	*/
	glOrtho( 0,   // left clip plane
  		    256, // right clip plane
		    0,   // bottom clip plane
		    256, // top clip plane
		    0.1, // near clip plane
		    100);// far clip plane

	gluLookAt(0,0,10,			// eye coords
			  0,0,0,			// object
			  0,1,0);			// normal
	glMatrixMode(GL_MODELVIEW);
}


int main()
{
	glutInitWindowSize(256,256);
	glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
	glutCreateWindow("GLUT example");
	glutDisplayFunc(display);
	glutReshapeFunc(reshape);

	glutMainLoop();
	return 0;
}
