int main(int argc, char *argv[]) { argc = argc; argv = argv; if (!initGraphics()) { fprintf(stderr, "Graphics initialization failed.\n"); return EXIT_FAILURE; } appInit(); while (gAppAlive) { struct timeval timeNow; while (XPending(sDisplay)) { XEvent ev; XNextEvent(sDisplay, &ev); switch (ev.type) { case KeyPress: { unsigned int keycode, keysym; keycode = ((XKeyEvent *)&ev)->keycode; keysym = XKeycodeToKeysym(sDisplay, keycode, 0); if (keysym == XK_Return || keysym == XK_Escape) gAppAlive = 0; } break; } } if (gAppAlive) { gettimeofday(&timeNow, NULL); appRender(timeNow.tv_sec * 1000 + timeNow.tv_usec / 1000, sWindowWidth, sWindowHeight); checkGLErrors(); eglSwapBuffers(sEglDisplay, sEglSurface); checkEGLErrors(); } } appDeinit(); deinitGraphics(); return EXIT_SUCCESS; }
void Java_com_example_SanAngeles_DemoRenderer_nativeDone( JNIEnv* env ) { appDeinit(); importGLDeinit(); }
void Java_at_tugraz_ist_droned_dcf_video_NativeVideoWrapper_nativeDroneClose( JNIEnv* env ) { appDeinit(); }
/* Call to finalize the graphics state */ void Java_cc_co_androidzoo_jplayerg_PlayerRenderer_nativeDone( JNIEnv* env ) { appDeinit(); importGLDeinit(); }
/* Call to finalize the graphics state */ void Java_com_StobDaoura_ToddlerShapePuzzle_DemoRenderer_nativeDone( JNIEnv* env ) { appDeinit(); importGLDeinit(); }
void CHeli::close() { appDeinit(); }
CHeli::~CHeli() { delete client; appDeinit(); }
/* Call to finalize the graphics state */ void Java_foam_nebogeo_nomadic_NomadicRenderer_nativeDone( JNIEnv* env ) { appDeinit(); importGLDeinit(); }
CHeli::~CHeli() { delete client; delete image; appDeinit(); }
/******************************************************************//** * @brief Programm entrypoint * * @retval EXIT_FAILURE * @retval err_not_init **********************************************************************/ int main(int argc, char *argv[]) { memset(&equipAddr,0,sizeof(in_addr)); /// 1. Process command line arguments \b argc and \b argv[] in ::process_cmdLine errType ret=process_cmdLine(argc, argv); /// - if arguments parsing is unsuccessfull exiting from programm if (ret!=err_result_ok) return ret; /// 2. Check arguments: /// - check for missing one of exact argument if ((eq_udp_sending_port==0) || (eq_udp_listen_port==0) || (equipAddr.s_addr==0)) { printf("Пропущен один из обязательных параметров:\n"); printf( " -u - сокет для сервисного общения с верхней иерархией системы\n" ); printf( " -s - сокет для посылки сообщений на нижнюю иерархию системы\n"); printf( " -r - сокет для приёма сообщений от нижней иерархии системы\n"); printf( " -i - адрес подсистемы обслуживания нижней иерархии\n\n"); return err_not_init; } /// - check for equipment communication settings: /// - sending port need to be not equal to listen port values /// - sending or listen port neet to be not equal to client listen port if ((eq_udp_sending_port==eq_udp_listen_port) || (eq_udp_sending_port==wUdp) || (eq_udp_listen_port==wUdp)) { printf("Ошибка параметров введены совпадающие номера сокетов\n"); return err_not_init; } /// - check for sending port number or listening port number was far from client port number on one port number /// that reserved for client sending port. if ((eq_udp_sending_port==wUdp+1) || (eq_udp_listen_port==wUdp+1)) { printf("Ошибка параметров: номер сокета оборудования взят из уже занятого пространства\n"); return err_not_init; } commonFuncsMgr *cf; specFuncsMgr *sf; /// 3. Install system signals handlers ::installSIGhandlers() installSIGhandlers(appDeinit); app=new srvAppLayer(wUdp); /// 4. Initialize application ::appInit() if (appInit()!=err_result_ok) AppTerminated=true; else { cf=new commonFuncsMgr(app); sf=new specFuncsMgr(app); ///4. Start functions generate from declarations ///- for common functions commonFuncsMgr::startCommonFuncs() cf->startCommonFuncs(); ///- for special functions specFuncsMgr::startSpecFuncs() sf->startSpecFuncs(); /// 5. Main programm loop srvAppLayer::ProcessMessages() while not terminated by signal srvAppLayer::terminated() while(!app->terminated()) { app->ProcessMessages(); } /// 6. Deinitialize application ::appDeinit() appDeinit(); if (app->terminated()==2) reboot(RB_AUTOBOOT); delete app; } printf("Работа программного средства завершена\n\n"); return (EXIT_FAILURE); }