// simplest.cpp : Defines the entry point for the console application. // #include #include void displayTorus() { printf("In Display\n"); glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); glColor3f(0.8, .2, .4); glutSolidTorus(.2, .6, 32, 64); glutSwapBuffers(); } int main(int argc, char* argv[]) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_RGB|GLUT_DOUBLE|GLUT_DEPTH); glutCreateWindow("Simple Glut"); glutDisplayFunc(displayTorus); glMatrixMode(GL_PROJECTION); gluPerspective(20,1,.001,1000); glMatrixMode(GL_MODELVIEW); gluLookAt(0,0,-5,0,0,0,0,1,0); glEnable(GL_DEPTH_TEST); glDisable(GL_LIGHTING); glEnable(GL_LIGHT0); glutMainLoop(); return 0; }