[artoolkit-commits] artoolkit/util/mk_patt mk_patt.c,1.10,1.11
Optical marker tracking and overlay for augmented reality.
Brought to you by:
philip_lamb
From: Philip L. <phi...@us...> - 2007-08-06 02:38:56
|
Update of /cvsroot/artoolkit/artoolkit/util/mk_patt In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv12751 Modified Files: mk_patt.c Log Message: Rename some fns for clarity, change Quit to cleanup. Index: mk_patt.c =================================================================== RCS file: /cvsroot/artoolkit/artoolkit/util/mk_patt/mk_patt.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** mk_patt.c 15 Sep 2006 03:08:18 -0000 1.10 --- mk_patt.c 6 Aug 2007 02:38:53 -0000 1.11 *************** *** 164,168 **** } ! static void Quit(void) { free(gARTsaveImage); gARTsaveImage = NULL; --- 164,168 ---- } ! static void cleanup(void) { free(gARTsaveImage); gARTsaveImage = NULL; *************** *** 170,174 **** arVideoCapStop(); arVideoClose(); - exit(0); } --- 170,173 ---- *************** *** 179,183 **** case 'Q': case 'q': ! Quit(); break; case 'T': --- 178,183 ---- case 'Q': case 'q': ! cleanup(); ! exit(0); break; case 'T': *************** *** 207,211 **** if (state == GLUT_DOWN) { if (button == GLUT_RIGHT_BUTTON) { ! Quit(); } else if (button == GLUT_MIDDLE_BUTTON) { printf("Enter new threshold value (default = 100): "); --- 207,212 ---- if (state == GLUT_DOWN) { if (button == GLUT_RIGHT_BUTTON) { ! cleanup(); ! exit(0); } else if (button == GLUT_MIDDLE_BUTTON) { printf("Enter new threshold value (default = 100): "); *************** *** 225,229 **** } ! static void Idle(void) { static int ms_prev; --- 226,230 ---- } ! static void mainLoop(void) { static int ms_prev; *************** *** 236,240 **** int i; ! // Find out how long since Idle() last ran. ms = glutGet(GLUT_ELAPSED_TIME); s_elapsed = (float)(ms - ms_prev) * 0.001; --- 237,241 ---- int i; ! // Find out how long since mainLoop() last ran. ms = glutGet(GLUT_ELAPSED_TIME); s_elapsed = (float)(ms - ms_prev) * 0.001; *************** *** 247,251 **** if (arDetectMarker(gARTImage, gARTThreshhold, &marker_info, &marker_num) < 0) { ! Quit(); } --- 248,252 ---- if (arDetectMarker(gARTImage, gARTThreshhold, &marker_info, &marker_num) < 0) { ! exit(-1); } *************** *** 272,276 **** { if (visible == GLUT_VISIBLE) { ! glutIdleFunc(Idle); } else { glutIdleFunc(NULL); --- 273,277 ---- { if (visible == GLUT_VISIBLE) { ! glutIdleFunc(mainLoop); } else { glutIdleFunc(NULL); *************** *** 382,386 **** // Register GLUT event-handling callbacks. ! // NB: Idle() is registered by Visibility. glutDisplayFunc(Display); glutReshapeFunc(Reshape); --- 383,387 ---- // Register GLUT event-handling callbacks. ! // NB: mainLoop() is registered by Visibility. glutDisplayFunc(Display); glutReshapeFunc(Reshape); |