int main() { init(); runMainLoop(); deinit(); return 0; }
int main(void) { int errorCode; FrameworkWindow *projectWindow; if(!initGlobalScreen(&newScreen)) { errorCode = -1; goto error; } initPalette(getGlobalViewPort()); projectWindow = newProjectWindow(); if(!projectWindow) { errorCode = -2; goto error_closeScreen; } runMainLoop(projectWindow); closeScreen: closeGlobalScreen(); done: return 0; error_closeScreen: closeGlobalScreen(); error: return errorCode; }
int main() { initGlWindow(); runMainLoop(); glfwTerminate(); return 0; }
void Program::run() { loadGlobalConfiguration(); initializeComponents(); runMainLoop(); cleanup(); }
void RTcmix::init(float tsr, int tnchans, int bsize, const char *opt1, const char *opt2, const char *opt3) { // for rtsetparams -- I forget why it's set up with both double // and float p-field arrays. Also, these aren't 0-ed out // so no need to dimension them at MAXDISPARGS float p[3]; double pp[3]; #ifdef SGI flush_all_underflows_to_zero(); #endif // set up the command lists, etc. ug_intro(); /* introduce standard routines */ // no profiles! See the note above about DSOs setbuf(stdout, NULL); /* Want to see stdout errors */ int nargs = 0; // set options if any are non-null p[0] = pp[0] = STRINGIFY(opt1); if (opt1) ++nargs; p[1] = pp[1] = STRINGIFY(opt2); if (opt2) ++nargs; p[2] = pp[2] = STRINGIFY(opt3); if (opt3) ++nargs; if (nargs) set_option(p, nargs, pp); // set the sampling rate and nchannels p[0] = pp[0] = tsr; p[1] = pp[1] = tnchans; p[2] = pp[2] = bsize; nargs = 3; rtsetparams(p, nargs, pp); if (Option::play() || Option::record()) { int retcode = runMainLoop(); if (retcode != 0) fprintf(stderr, "runMainLoop() failed\n"); } else { // If we are not playing or recording from HW, we cannot be interactive rtInteractive = 0; } }
int main() { cfg_init(); try { //world::World w; World w; w.backends.push_back(std::shared_ptr<WorldBackend>(new FlatGenerator(w))); Renderer r(w); mainLoopEvent.push(std::bind(&Renderer::render, &r, std::placeholders::_1)); runMainLoop(); } catch(std::exception &e) { std::cerr << e.what() << std::endl; } return 0; }
int CApplication::run(int argc, const char argv[]) { if (false == initialize()) { std::cerr << "initialize() failed." << std::endl; return EXIT_FAILURE; } if (false == createComponents(argc, argv)) { std::cerr << "createComponents() failed." << std::endl; return EXIT_FAILURE; } runMainLoop(); return EXIT_SUCCESS; }
int Renderer::begin() { setupRenderer(); if (fragmentShaderPath == "" || vertexShaderPath == "") { std::cout << "WARNING: no shader loaded..." << std::endl; } if (objects.size() == 0) { std::cout << "WARNING: no objects loaded..." << std::endl; } _shaderProgram = setupShaders(); if (!_shaderProgram) { std::cout << "ERROR: Falied to initialize shaders." << std::endl; return 1; } std::cout << "Started visualization with " << objects.size() << " objects." << std::endl; runMainLoop(_window, _shaderProgram); terminate(); return 0; }
void RTcmix::run() { int retcode; if (!Option::play() && !Option::record() && rtfileit == 1) { /* Create scheduling/audio thread. */ rtcmix_debug(NULL, "RTcmix::run calling runMainLoop()"); retcode = runMainLoop(); if (retcode != 0) { rtcmix_warn(NULL, "RTcmix::run: runMainLoop() failed"); } else { /* Wait for audio thread. */ rtcmix_debug(NULL, "RTcmix::run calling waitForMainLoop()"); retcode = waitForMainLoop(); if (retcode != 0) { rtcmix_warn(NULL, "RTcmix::run: waitForMailLoop() failed"); } } } }
int main() { auto armyEngine = ArmyEngine::getInstance(); armyEngine->addEntity(createCursor()); armyEngine->addEntity(createButton("Resume", 100, 100)); /*armyEngine->addEntity(createButton("Restart", 100, 60)); armyEngine->addEntity(createButton("Quit", 100, 110)); armyEngine->addEntity(createButton("Other3", 100, 160)); armyEngine->addEntity(createButton("Other1", 250, 10)); armyEngine->addEntity(createButton("Other2", 250, 60)); armyEngine->addEntity(createButton("Other3", 250, 110)); armyEngine->addEntity(createButton("Other3", 250, 160)); armyEngine->addEntity(createButton("Other1", 400, 10)); armyEngine->addEntity(createButton("Other2", 400, 60)); armyEngine->addEntity(createButton("Other3", 400, 110)); armyEngine->addEntity(createButton("Other3", 400, 160)); armyEngine->addEntity(createButton("Other1", 550, 10)); armyEngine->addEntity(createButton("Other2", 550, 60)); armyEngine->addEntity(createButton("Other3", 550, 110)); armyEngine->addEntity(createButton("Other3", 550, 160)); armyEngine->addEntity(createButton("Other1", 700, 10)); armyEngine->addEntity(createButton("Other2", 700, 60)); armyEngine->addEntity(createButton("Other3", 700, 110)); armyEngine->addEntity(createButton("Other3", 700, 160));*/ //create the close program event armyEngine->addEventCallback(EnumEventType::EVENT_CLOSED, [] (int eventIndex) { auto armyEngine = ArmyEngine::getInstance(); auto window = armyEngine->getWindow(); window->close(); return 0; }); armyEngine->runMainLoop(); return 0; }
void RTcmix::run() { int retcode; if (!Option::play() && !Option::record() && rtfileit == 1) { /* Create scheduling/audio thread. */ #ifdef DBUG fprintf(stdout, "calling runMainLoop()\n"); #endif retcode = runMainLoop(); if (retcode != 0) { fprintf(stderr, "runMainLoop() failed\n"); } else { /* Wait for audio thread. */ #ifdef DBUG fprintf(stdout, "calling waitForMainLoop()\n"); #endif retcode = waitForMainLoop(); if (retcode != 0) { fprintf(stderr, "waitForMailLoop() failed\n"); } } } }
void SFLD::start(){ init(); runMainLoop(); }