[artoolkit-commits] artoolkit/util/calib_cparam calib_cparam.c,1.9,1.10
Optical marker tracking and overlay for augmented reality.
Brought to you by:
philip_lamb
From: Philip L. <phi...@us...> - 2005-09-22 00:44:49
|
Update of /cvsroot/artoolkit/artoolkit/util/calib_cparam In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3240 Modified Files: calib_cparam.c Log Message: Step 3 of cleanup. Index: calib_cparam.c =================================================================== RCS file: /cvsroot/artoolkit/artoolkit/util/calib_cparam/calib_cparam.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** calib_cparam.c 15 Sep 2005 00:52:48 -0000 1.9 --- calib_cparam.c 22 Sep 2005 00:44:41 -0000 1.10 *************** *** 81,85 **** static ARUint8 *gARTImage = NULL; ! static ARParam gARTCparam; static ARGL_CONTEXT_SETTINGS_REF gArglSettings = NULL; --- 81,85 ---- static ARUint8 *gARTImage = NULL; ! static ARParam gARTCparam; // Dummy parameter, to supply to gsub_lite. static ARGL_CONTEXT_SETTINGS_REF gArglSettings = NULL; *************** *** 252,256 **** // Cancel from mode 0 should quit program. arVideoCapStop(); - arVideoClose(); Quit(); } else if (mode == 1) { --- 252,255 ---- *************** *** 270,273 **** --- 269,274 ---- static void Mouse(int button, int state, int x, int y) { + ARUint8 *image; + if (state == GLUT_DOWN) { if (button == GLUT_RIGHT_BUTTON) { *************** *** 275,281 **** } else if (button == GLUT_LEFT_BUTTON && mode == 0) { // Processing a new image. ! // Copy the current image to saved image buffer. ! if (!gARTImage) return; ! memcpy(gSaveARTImage, gARTImage, gXsize*gYsize*AR_PIX_SIZE); printf("Grabbed image.\n"); arVideoCapStop(); --- 276,284 ---- } else if (button == GLUT_LEFT_BUTTON && mode == 0) { // Processing a new image. ! // Copy an image to saved image buffer. ! do { ! image = arVideoGetImage(); ! } while (image == NULL); ! memcpy(gSaveARTImage, image, gXsize*gYsize*AR_PIX_SIZE); printf("Grabbed image.\n"); arVideoCapStop(); *************** *** 409,412 **** --- 412,416 ---- if (gArglSettings) arglCleanup(gArglSettings); if (gWin) glutDestroyWindow(gWin); + arVideoClose(); exit(0); } *************** *** 476,483 **** static void endOrtho2D(void) { - glPopMatrix(); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); } --- 480,487 ---- static void endOrtho2D(void) { glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); + glPopMatrix(); } *************** *** 488,491 **** --- 492,497 ---- glClear(GL_COLOR_BUFFER_BIT); glDisable(GL_DEPTH_TEST); + glDisable(GL_LIGHTING); + glDisable(GL_TEXTURE_2D); beginOrtho2D(); *************** *** 494,497 **** --- 500,504 ---- arglDispImage(gARTImage, &gARTCparam, 1.0, gArglSettings); // zoom = 1.0. arVideoCapNext(); + gARTImage = NULL; } else if (mode == 1) { |