示例#1
0
int main(int argc, char* argv[])
{  
	App game;

	game.Init();

	return game.Run();
}
示例#2
0
int main()
{
	App app;
	app.Init();
	app.Run();
	app.Exit();
	return 0;
}
示例#3
0
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, 
    LPSTR lpszCmdLine, int nCmdShow)
{
    App *A = new App;                    //create a new App
    A->Init(hInstance, nCmdShow);        //initalize App
    A->MessageLoop(hInstance, nCmdShow); //begin App's "lifetime" (looping for messages.  all frames occur here.)
    A->FreeMemory();                     //kill App
    return 0;                            //exit Main
}
示例#4
0
int	main(void){
	SystemInit();
	app.Init();
//	timer.Start();

	while(true){
		app.loop();
	}
}
示例#5
0
文件: WinMain.cpp 项目: konlil/kexe
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
{
	App *a = new App;
	a->Init(hInstance, nCmdShow);
	a->MessageLoop(hInstance, nCmdShow);
	a->FreeMemory();
	delete a;

	return 0;
}
示例#6
0
int main()
{
    App theApp;

    theApp.Init();
    theApp.Run();
    theApp.Exit();

    return 0;
}
示例#7
0
文件: main.cpp 项目: AndersUa/NBody
int main(int argc, char** argv)
{
	App* app = new App(GLUTBackend::GetInstance());
	if (!app->Init(argc, argv))
	{
		fprintf(stderr, "Init faild");
		getchar();
		return 1;
	}
	app->Run();
	delete app;
	return 0;
}
示例#8
0
int WINAPI WinMain(HINSTANCE , HINSTANCE , LPSTR , int )
{
	SetCurrentDirectory("..\\Bin");

	HGE* hgeEngine=HGE_Init();

	if(hgeEngine==NULL)
	{
		return(-1);
	}

	MSG windowsMessage;

	Renderer::Create( hgeEngine );
	Root::Create();

	Input::InputWrapper input;
	input.Initialize( hgeEngine->System_GetState( HGE_HWND ), Vector2f() );

	Root::GetInstance()->AttachInputWrapper( &input );

	App application;

	application.Init();
	for(;;)
	{
		// check for messages
		if ( PeekMessage( &windowsMessage, NULL, 0, 0, PM_REMOVE ) ) 
		{
			// handle or dispatch messages
			if ( windowsMessage.message == WM_QUIT )
			{
				break;
			}
			TranslateMessage( &windowsMessage );
			DispatchMessage( &windowsMessage );
		} 
		else
		{
			application.update();
		}

	}

	HGE_Shutdown(hgeEngine);

	// Clean up and shutdown
	return 0;
}
示例#9
0
int
main(int argc, char* argv[])
{
	app.Init();
	// Infinite loop
	while (1)
	{
		//光强传感器值,大概范围0~300
		sensor.Converted();
		app.mFireSensor = sensor.mConvertedVoltage[0]*100;
		app.mSmokeSensor = sensor.mConvertedVoltage[1]*100;
		//循环 
		app.loop();
	}
}
示例#10
0
int main(int argc, char** argv)
{
	App app;

	// Create a GLUT window
	InitializeWindow(argc, argv, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_TITLE, &app);

	// Initialize that app
	if (!app.Init())
	{
		fprintf(stderr, "Failed to initialize app.\n");
		system("pause");
		return 17;
	}

	return 0;
}
示例#11
0
int
main(int argc, char* argv[])
{
	TaskManager::DelayS(3);
	//系统初始化
	app.Init();
	//开启定时器
	timer.Start();
	//循环体
	while (1)
	{
		//将光传感器的值采集出来并且放到app对象的变量中
		lightSensor.Converted();//ADC转换
		app.mLightSensor = lightSensor.mConvertedVoltage[3]*100;//获取光感值
		
		
		//循环 
		app.loop();
	}
}
示例#12
0
extern "C" int SDL_main( int argc, char* argv[] )
#endif
{
    std::set_unexpected( HandleUnexpected );
	try {
#ifdef __linux__
		gtk_init(&argc,&argv);
#endif
		App app;
		app.Init( argc, argv );
		return app.Run();
	}
    catch ( std::bad_alloc &ex ) {
        ShowError( ex.what(), "Memory Exception in Application" );
    }
    catch ( std::exception &ex ) {
        ShowError( ex.what(), "Exception in Application" );
    }
    catch ( ... ) {
        ShowError( "Unknown Error!", "Unknown Error in Application" );
    }
	return -1;
}
示例#13
0
文件: Main.cpp 项目: RedSray/JRPG
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	{
		AllocConsole();
		freopen("CONIN$", "r", stdin); 
		freopen("CONOUT$", "w", stdout); 
		freopen("CONOUT$", "w", stderr); 
		//JUST FOR FUN
		std::cout << " ____  ____  ____  __  __  ___ " << std::endl;
		std::cout << "(  _ \\( ___)(  _ \\(  )(  )/ __)" << std::endl;
		std::cout << " )(_) ))__)  ) _ < )(__)(( (_-." << std::endl;
		std::cout << "(____/(____)(____/(______)\\___/\n" << std::endl;
		std::cout << "-Launching Application-\n" << std::endl;
	}

	App application;

	application.Init();

	application.Run();

	return 0;
};
示例#14
0
int main( int argc, char** argv )
{
	bool bFullScreen = false;
	unsigned int displayWidth = 1280;
	unsigned int displayHeight = 720;
	for( int i = 1; i < argc; ++i )
	{
		if( strcmp( argv[i], "--fullscreen" ) == 0 )
		{
			bFullScreen = true;
		}
		else if( strcmp( argv[i], "--width" ) == 0)
		{
			SDL_assert( argc > i ); // make sure we have another argument
			displayWidth = (unsigned int)atoi( argv[++i] );
		}
		else if(strcmp( argv[i], "--height" ) == 0)
		{
			SDL_assert( argc > i ); // make sure we have another argument
			displayHeight = (unsigned int)atoi( argv[++i] );
		}
	}

	App app;
	if( !app.Init( bFullScreen, displayWidth, displayHeight ) )
	{
		printf( "ERROR - App failed to initialise\n" );
		app.ShutDown();
		return 1;
	}

	app.Run();

	app.ShutDown();

	return 0;
}