int main(int argc,char* argv[]) { //Initialize GLUT FreeImage_Initialise(); glutInit(&argc,argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH); glutCreateWindow("HW1: Transformations"); init(); glutDisplayFunc(display); glutSpecialFunc(specialKey); glutKeyboardFunc(keyboard); glutReshapeFunc(reshape); glutReshapeWindow(w,h); if(argc > 1) { allowGrader = true; grader.init(argv[1]); grader.loadCommands(argv[1]); grader.bindDisplayFunc(display); grader.bindSpecialFunc(specialKey); grader.bindKeyboardFunc(keyboard); grader.bindScreenshotFunc(saveScreenshot); } printHelp(); glutMainLoop(); FreeImage_DeInitialise(); return 0; }
int main(int argc, char *argv[]) { if (argc < 2) { cerr << "Usage: transforms scenefile [grader input (optional)]\n"; exit(-1); } FreeImage_Initialise(); glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH); glutCreateWindow("HW2: Scene Viewer"); init(); readfile(argv[1]); glutDisplayFunc(display); glutSpecialFunc(specialKey); glutKeyboardFunc(keyboard); glutReshapeFunc(reshape); glutReshapeWindow(w, h); if (argc > 2) { allowGrader = true; stringstream tcid; tcid << argv[1] << "." << argv[2]; grader.init(tcid.str()); grader.loadCommands(argv[2]); grader.bindDisplayFunc(display); grader.bindSpecialFunc(specialKey); grader.bindKeyboardFunc(keyboard); grader.bindScreenshotFunc(saveScreenshot); } printHelp(); glutMainLoop(); FreeImage_DeInitialise(); return 0; }