Update of /cvsroot/artoolkit/artoolkit/util/calib_camera2
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv12739
Modified Files:
main.c
Log Message:
Rename some fns for clarity, change Quit to cleanup.
Index: main.c
===================================================================
RCS file: /cvsroot/artoolkit/artoolkit/util/calib_camera2/main.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** main.c 22 Feb 2007 21:53:13 -0000 1.15
--- main.c 6 Aug 2007 02:38:47 -0000 1.16
***************
*** 109,113 ****
static void Keyboard(unsigned char key, int x, int y);
static void Quit(void);
! static void Idle(void);
static void Visibility(int visible);
static void Reshape(int w, int h);
--- 109,113 ----
static void Keyboard(unsigned char key, int x, int y);
static void Quit(void);
! static void mainLoop(void);
static void Visibility(int visible);
static void Reshape(int w, int h);
***************
*** 143,147 ****
// Register GLUT event-handling callbacks.
! // NB: Idle() is registered by Visibility.
glutDisplayFunc(Display);
glutReshapeFunc(Reshape);
--- 143,147 ----
// Register GLUT event-handling callbacks.
! // NB: mainLoop() is registered by Visibility.
glutDisplayFunc(Display);
glutReshapeFunc(Reshape);
***************
*** 263,267 ****
printf("Not enough images to proceed with calibration. Exiting.\n");
}
! Quit();
}
}
--- 263,268 ----
printf("Not enough images to proceed with calibration. Exiting.\n");
}
! cleanup();
! exit(0);
}
}
***************
*** 275,279 ****
if (gPatt.loop_num == 0) {
// No images with all features identified, so quit.
! Quit();
} else {
// At least one image with all features identified,
--- 276,281 ----
if (gPatt.loop_num == 0) {
// No images with all features identified, so quit.
! cleanup();
! exit(0);
} else {
// At least one image with all features identified,
***************
*** 467,471 ****
}
! static void Quit(void)
{
if (gClipImage) {
--- 469,473 ----
}
! static void cleanup(void)
{
if (gClipImage) {
***************
*** 476,483 ****
if (gWin) glutDestroyWindow(gWin);
arVideoClose();
- exit(0);
}
! static void Idle(void)
{
static int ms_prev;
--- 478,484 ----
if (gWin) glutDestroyWindow(gWin);
arVideoClose();
}
! static void mainLoop(void)
{
static int ms_prev;
***************
*** 486,490 ****
ARUint8 *image;
! // Find out how long since Idle() last ran.
ms = glutGet(GLUT_ELAPSED_TIME);
s_elapsed = (float)(ms - ms_prev) * 0.001;
--- 487,491 ----
ARUint8 *image;
! // Find out how long since mainLoop() last ran.
ms = glutGet(GLUT_ELAPSED_TIME);
s_elapsed = (float)(ms - ms_prev) * 0.001;
***************
*** 509,513 ****
{
if (visible == GLUT_VISIBLE) {
! glutIdleFunc(Idle);
} else {
glutIdleFunc(NULL);
--- 510,514 ----
{
if (visible == GLUT_VISIBLE) {
! glutIdleFunc(mainLoop);
} else {
glutIdleFunc(NULL);
|