本文整理汇总了C++中Main::run方法的典型用法代码示例。如果您正苦于以下问题:C++ Main::run方法的具体用法?C++ Main::run怎么用?C++ Main::run使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Main
的用法示例。
在下文中一共展示了Main::run方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
{
cout<<"Fluid simulation"<<endl;
// Defaults
logging = true;
sequential = false;
render = true;
deviceType = CL_DEVICE_TYPE_ALL;
int targetFPS = 20;
// Parse arguments
for(int i = 0; i < argc; i++)
{
if(strcmp(argv[i], "-nolog") == 0)
logging = false;
else if(strcmp(argv[i], "-cpu") == 0)
deviceType = CL_DEVICE_TYPE_CPU;
else if(strcmp(argv[i], "-gpu") == 0)
deviceType = CL_DEVICE_TYPE_GPU;
else if(strcmp(argv[i], "-sequential") == 0)
sequential = true;
else if(strcmp(argv[i], "-fps") == 0)
targetFPS = atoi(argv[i+1]);
else if(strcmp(argv[i], "-norender") == 0)
render = false;
}
//Start simulating!
mainProgram.initialize(targetFPS);
mainProgram.run();
}
示例2: main
int main( int argc, char ** argv, char **envp ) {
openlog( SHEBANG, 0, LOG_LOCAL2 );
setlogmask( LOG_UPTO( LOG_INFO ) );
Main main;
main.parseArgs( argc, argv, envp );
return main.run();
}
示例3: main
int main(int argc, char** argv) {
Main* main = new Main(argc, argv);
main->run();
delete main;
return 0;
}
示例4: main
int main(int argc, char* args[]) {
if(argc > 1) {
if(strcmp(args[1], "-f") == 0) {
Main::flags |= SDL_FULLSCREEN;
}
}
Main main;
return main.run();
}
示例5: main
int main(int argc, char** argv)
{
signal(SIGINT, signal_handler);
try {
return main_program.run(argc, argv);
} catch(std::exception& e) {
cout << "Top Level Exception: " << e.what() << endl;
}
}
示例6: main
s32 main(s32 argc, char* argv[])
{
std::string log_name = get_option(argv, argc, "-l");
std::string rom = "../bin/Ca Da.gb"; // If a ROM isn't specified on command line, then execute the ROM specified here
if (log_name == "-")
{
log_name = "../bin/GBS.log"; // If a log name isn't specified, use the default
}
if (argc >= 2)
{
rom = argv[1];
}
if (!init_logging(log_name))
{
log(ERROR, "Initialization of logging failed.");
return exit(true);
}
Game game;
if (!game.load(rom))
{
log(ERROR, "Failed to load the ROM.");
return exit(true);
}
Main* core = nullptr;
switch (game.game_type)
{
case GAMEBOY_COLOR:
case GAMEBOY: core = new GBMain(game); break;
default: log(ERROR, "Unsupported game type: %d", game.game_type); return exit(true);
}
if (!core->initialize())
{
log(ERROR, "Failed to initialize emulation core.");
return exit(true);
}
core->run();
}
示例7: main
int main(int argc, char **argv) {
Main m;
return m.run(argc, argv);
}
示例8: main
int main()
{
Uart::getInstance()->init((volatile uint32_t *)UART_BASE);
Main *main = new Main();
return main->run();
}