void CleanUp(){ nyar_NyARTransMat_O2_free(nyobj); mqoDeleteModel(WallModel); for (int i=0;i<box_variey_num;i++){ mqoDeleteModel(Box[i]); } mqoCleanup(); arVideoCapStop(); arVideoClose(); argCleanup(); }
int main(int argc,char**argv){ ARParam cparam; ARParam wparam; int xsize,ysize; glutInit(&argc,argv); if(arVideoOpen(vconf_name)<0){ puts("ビデオデバイスエラー"); return -1; } if(arVideoInqSize(&xsize,&ysize) < 0)return -1; if(arParamLoad(cparam_name,1,&wparam)< 0){ puts("パラメータ読み込み失敗"); return -1; } arParamChangeSize(&wparam,xsize,ysize,&cparam); arInitCparam(&cparam); nyobj = nyar_NyARTransMat_O2_create(&cparam); if( (patt_id=arLoadPatt(pattern_name)) < 0){ puts("パターン読み込みエラー"); return -1; } argInit(&cparam, 1.0, 0, 0, 0, 0); mqoInit(); if(Data_Load()==-1) return -1; arVideoCapStart(); InitGame(); arUtilTimerReset(); #ifdef _WIN32 TIMECAPS Caps; timeGetDevCaps(&Caps, sizeof(TIMECAPS)); // 性能取得 timeBeginPeriod(Caps.wPeriodMin); #endif argMainLoop(MouseEvent,KeyEvent,MainLoop); #ifdef _WIN32 timeEndPeriod(Caps.wPeriodMin); #endif nyar_NyARTransMat_O2_free(nyobj); return 0; }
//====================== // ライブラリの終了処理 //====================== void cARTK::cleanup( void ) { if( m_pArglSettings ) { arglCleanup( m_pArglSettings ); m_pArglSettings = NULL; } if( m_pNyARInst ) { nyar_NyARTransMat_O2_free( m_pNyARInst ); m_pNyARInst = NULL; } arVideoCapStop(); arVideoClose(); }