int main(int argc, char **argv) { int i; #ifdef XCURSES Xinitscr(argc, argv); #else initscr(); #endif nodelay(stdscr, TRUE); noecho(); if (has_colors()) start_color(); for (i = 0; i < 8; i++) init_pair(i, color_table[i], COLOR_BLACK); seed = time((time_t *)0); srand(seed); #ifdef EMSCRIPTEN emscripten_set_main_loop(one_iter, 1000/DELAYSIZE, FALSE); #else while (getch() == ERR) /* loop until a key is hit */ one_iter(); endwin(); #endif return 0; }
int main (int argc, char **argv) { int flag; glutInit (&argc, argv); print_description (); flag = SDL_Init (SDL_INIT_VIDEO); if (flag < 0) { fprintf (stderr, "SDL initialize Hum! \n"); } atexit (SDL_Quit); SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); surface = SDL_SetVideoMode (window_width, window_height, 0, SDL_OPENGL | SDL_RESIZABLE); if (surface == NULL) { fprintf (stderr, "SDL Video initialize Ha!\n"); } SDL_WM_SetCaption (TITLE, NULL); initialize(); #ifdef EMSCRIPTEN emscripten_set_main_loop (one_iter, 30, 0); #else /* #ifdef EMSCRIPTEN */ for (;;) { one_iter (); } #endif /* #ifdef EMSCRIPTEN */ return 1; }
int main(int argc, char *argv[]) { Natorium::s_exePath = argv[0]; kernel = new Natorium::Kernel(); kernel->Init(); #if defined(EMSCRIPTEN_TARGET) emscripten_set_main_loop(one_iter, 0, 0); #else while(kernel->IsRunning()) { one_iter(); std::this_thread::sleep_for(std::chrono::milliseconds(1)); } #endif kernel->DeInit(); delete kernel; return 0; }