// example file for glut-gl // author: Matteo Lucarelli #include #include void display_cb() { glClear( GL_COLOR_BUFFER_BIT); glColor3d( 1.0, 1.0, 1.0 ); glBegin(GL_POLYGON); glVertex2f( 0.5, 0.5); glVertex2f(-0.5, 0.5); glVertex2f(-0.5,-0.5); glVertex2f( 0.5,-0.5); glEnd(); glutSwapBuffers( ); } int main(int argc, char** argv) { glutInit( &argc, argv ); glutInitWindowSize( 100, 100 ); glutCreateWindow("hello"); glutDisplayFunc(display_cb); glutMainLoop(); return 0; }