Update of /cvsroot/artoolkit/artoolkit/examples/simpleLite
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv11919
Modified Files:
simpleLite.c
Log Message:
Rename some fns for clarity, change Quit to cleanup.
Index: simpleLite.c
===================================================================
RCS file: /cvsroot/artoolkit/artoolkit/examples/simpleLite/simpleLite.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** simpleLite.c 20 Mar 2007 04:28:56 -0000 1.24
--- simpleLite.c 6 Aug 2007 02:36:07 -0000 1.25
***************
*** 232,241 ****
}
! static void Quit(void)
{
arglCleanup(gArglSettings);
arVideoCapStop();
arVideoClose();
- exit(0);
}
--- 232,240 ----
}
! static void cleanup(void)
{
arglCleanup(gArglSettings);
arVideoCapStop();
arVideoClose();
}
***************
*** 248,252 ****
case 'Q':
case 'q':
! Quit();
break;
case ' ':
--- 247,252 ----
case 'Q':
case 'q':
! cleanup();
! exit(0);
break;
case ' ':
***************
*** 302,306 ****
}
! static void Idle(void)
{
static int ms_prev;
--- 302,306 ----
}
! static void mainLoop(void)
{
static int ms_prev;
***************
*** 313,317 ****
int j, k;
! // Find out how long since Idle() last ran.
ms = glutGet(GLUT_ELAPSED_TIME);
s_elapsed = (float)(ms - ms_prev) * 0.001;
--- 313,317 ----
int j, k;
! // Find out how long since mainLoop() last ran.
ms = glutGet(GLUT_ELAPSED_TIME);
s_elapsed = (float)(ms - ms_prev) * 0.001;
***************
*** 363,367 ****
{
if (visible == GLUT_VISIBLE) {
! glutIdleFunc(Idle);
} else {
glutIdleFunc(NULL);
--- 363,367 ----
{
if (visible == GLUT_VISIBLE) {
! glutIdleFunc(mainLoop);
} else {
glutIdleFunc(NULL);
***************
*** 435,448 ****
{
char glutGamemode[32];
! const char *cparam_name = "Data/camera_para.dat";
! //
! // Camera configuration.
! //
! #ifdef _WIN32
! char *vconf = "Data\\WDM_camera_flipV.xml";
! #else
! char *vconf = "";
! #endif
! const char *patt_name = "Data/patt.hiro";
// ----------------------------------------------------------------------------
--- 435,441 ----
{
char glutGamemode[32];
! char *cparam_name = "Data/camera_para.dat";
! char *vconf = "";
! char *patt_name = "Data/patt.hiro";
// ----------------------------------------------------------------------------
***************
*** 477,483 ****
}
! // Setup argl library for current context.
if ((gArglSettings = arglSetupForCurrentContext()) == NULL) {
fprintf(stderr, "main(): arglSetupForCurrentContext() returned error.\n");
exit(-1);
}
--- 470,477 ----
}
! // Setup ARgsub_lite library for current OpenGL context.
if ((gArglSettings = arglSetupForCurrentContext()) == NULL) {
fprintf(stderr, "main(): arglSetupForCurrentContext() returned error.\n");
+ cleanup();
exit(-1);
}
***************
*** 485,496 ****
glEnable(GL_DEPTH_TEST);
arUtilTimerReset();
!
if (!setupMarker(patt_name, &gPatt_id)) {
fprintf(stderr, "main(): Unable to set up AR marker.\n");
! Quit();
}
// Register GLUT event-handling callbacks.
! // NB: Idle() is registered by Visibility.
glutDisplayFunc(Display);
glutReshapeFunc(Reshape);
--- 479,492 ----
glEnable(GL_DEPTH_TEST);
arUtilTimerReset();
!
! // Load marker(s).
if (!setupMarker(patt_name, &gPatt_id)) {
fprintf(stderr, "main(): Unable to set up AR marker.\n");
! cleanup();
! exit(-1);
}
// Register GLUT event-handling callbacks.
! // NB: mainLoop() is registered by Visibility.
glutDisplayFunc(Display);
glutReshapeFunc(Reshape);
|