/* * glshpere.c * (c) Neil Gershenfeld 8/30/97 * draw a sphere with GLUT */ #include void display(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glutSolidSphere(0.8,50,50); glFlush(); } void mouse(int button, int state, int x, int y) { exit(0); } void main(int argc, char **argv) { glutInit(&argc,argv); glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH); glutInitWindowSize(500,500); glutCreateWindow("GLUT sphere example"); glutDisplayFunc(display); glutMouseFunc(mouse); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); glEnable(GL_DEPTH_TEST); glClearColor(1.0,1.0,1.0,1.0); glMatrixMode(GL_PROJECTION); glRotatef(-140.0,1.0,1.0,0.0); glutMainLoop(); }