[artoolkit-commits] artoolkit/examples/simpleVRML simpleVRML.c, 1.18, 1.19
Optical marker tracking and overlay for augmented reality.
Brought to you by:
philip_lamb
From: Philip L. <phi...@us...> - 2007-08-06 02:32:57
|
Update of /cvsroot/artoolkit/artoolkit/examples/simpleVRML In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv10431 Modified Files: simpleVRML.c Log Message: Rename some fns for clarity, change Quit to cleanup. Index: simpleVRML.c =================================================================== RCS file: /cvsroot/artoolkit/artoolkit/examples/simpleVRML/simpleVRML.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** simpleVRML.c 23 Jan 2007 00:39:27 -0000 1.18 --- simpleVRML.c 6 Aug 2007 02:32:54 -0000 1.19 *************** *** 185,189 **** } ! static void Quit(void) { arglCleanup(gArglSettings); --- 185,189 ---- } ! static void cleanup(void) { arglCleanup(gArglSettings); *************** *** 193,197 **** CoUninitialize(); #endif - exit(0); } --- 193,196 ---- *************** *** 204,208 **** case 'Q': case 'q': ! Quit(); break; case 'C': --- 203,208 ---- case 'Q': case 'q': ! cleanup(); ! exit(0); break; case 'C': *************** *** 255,259 **** } ! static void Idle(void) { static int ms_prev; --- 255,259 ---- } ! static void mainLoop(void) { static int ms_prev; *************** *** 266,270 **** int i, j, k; ! // Find out how long since Idle() last ran. ms = glutGet(GLUT_ELAPSED_TIME); s_elapsed = (float)(ms - ms_prev) * 0.001; --- 266,270 ---- int i, j, k; ! // Find out how long since mainLoop() last ran. ms = glutGet(GLUT_ELAPSED_TIME); s_elapsed = (float)(ms - ms_prev) * 0.001; *************** *** 330,334 **** { if (visible == GLUT_VISIBLE) { ! glutIdleFunc(Idle); } else { glutIdleFunc(NULL); --- 330,334 ---- { if (visible == GLUT_VISIBLE) { ! glutIdleFunc(mainLoop); } else { glutIdleFunc(NULL); *************** *** 456,459 **** --- 456,460 ---- if ((gArglSettings = arglSetupForCurrentContext()) == NULL) { fprintf(stderr, "main(): arglSetupForCurrentContext() returned error.\n"); + cleanup(); exit(-1); } *************** *** 464,468 **** if (!setupMarkersObjects(objectDataFilename, &gObjectData, &gObjectDataCount)) { fprintf(stderr, "main(): Unable to set up AR objects and markers.\n"); ! Quit(); } --- 465,470 ---- if (!setupMarkersObjects(objectDataFilename, &gObjectData, &gObjectDataCount)) { fprintf(stderr, "main(): Unable to set up AR objects and markers.\n"); ! cleanup(); ! exit(-1); } *************** *** 478,482 **** // Register GLUT event-handling callbacks. ! // NB: Idle() is registered by Visibility. glutDisplayFunc(Display); glutReshapeFunc(Reshape); --- 480,484 ---- // Register GLUT event-handling callbacks. ! // NB: mainLoop() is registered by Visibility. glutDisplayFunc(Display); glutReshapeFunc(Reshape); |