#include <GL/glut.h>
#include <GL/gl.h>
#include <GL/glu.h>
void display(void)
{
int i;
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(0.0, 0.0, 1.0);
glBegin(GL_POLYGON);
glVertex3f(1.1, 1.1, 0.1);
glVertex3f(2.7, 2.1, 0.5);
glVertex3f(2.7, 2.7, 0.1);
glVertex3f(1.1, 2.7, 0.5);
glEnd();
glFlush();
}
void init(void)
{
glClearColor(1.0,0.0,0.0,0.0);
//glMatrixMode(GL_PROJECTION);
//glLoadIdentity();
glOrtho(0.0, 3.0, 0.0, 3.0, -1.0, 1.0);
}
int main(int argc,char **argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE);
//glutInitWindowSize(1600, 1600);
//glutInitWindowPosition(100, 100);
glutCreateWindow("hello");
glClearColor(1.0f,0.0f,0.0f,0.0f);
glClear(GL_COLOR_BUFFER_BIT);
init();
glutDisplayFunc(display);
glClearColor(0.0,1.0,0.0,0.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//glutReshapeFunc(resize(100,200));
glutMainLoop();
return 0;
}