Exemple #1
0
int main( int argc, char *argv[] )
{
	if( argc < 2 )
	{
		App* pcApp = new App( "empty" );
		pcApp->Run();
		return( 0 );
	}
	else
	{
		App* pcApp = new App( argv[1] );
		pcApp->Run();
		return( 0 );
	}
}
Exemple #2
0
int main(int argc, char** argv)
{
	App app;
	app.Run();

	return 0;
}
Exemple #3
0
int main(int argc, char** argv)
{
	App* app = new TutCollisionDetection();
	app->Run();

	return 0;
}
Exemple #4
0
int
main()
{
	App app;
	app.Run();
	return 0;
}
Exemple #5
0
int main(int argc, char *argv[])
{
	App *app = new App();
	
	app->Run();
	delete app;
}
Exemple #6
0
int WINAPI WinMain(HINSTANCE hInstance,
				   HINSTANCE hPrevInstance,
				   LPSTR lpCmdLine,
				   int nCmdShow)
{	
	_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);

	//生成
	App* app = NULL;

	try{
		app = new App(hInstance,FALSE);
	}catch(char *str){
		DisplayErrMsg(str);
		SAFE_DELETE(app);
		return(0);
	}

	//実行
	app->Run();

	//消去
	SAFE_DELETE(app);

	return(0);
}
Exemple #7
0
int main()
{
	App app;
	app.Init();
	app.Run();
	app.Exit();
	return 0;
}
Exemple #8
0
int
main(void)
{
	App *app = new App();
	app->Run();
	delete app;
	return 0;
}
Exemple #9
0
int main(int argc, char* argv[])
{  
	App game;

	game.Init();

	return game.Run();
}
Exemple #10
0
int main()
{
    App theApp;

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

    return 0;
}
Exemple #11
0
int main()
{
   App app;
   
   cout << "Starting app main loop\n";

   app.Run();
   
   
   return 0;
}
int
main(void)
{
  //set up application (watch Dropbox folder & contents)
  App *app = new App();

  //start the application
  app->Run();

  //clean up now that we're shutting down
  delete app;
  return 0;
}
Exemple #13
0
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;
}
Exemple #14
0
INT APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, INT nCmdShow)
{
	C3DUINT16 uiWidth	= 400;
	C3DUINT16 uiHeight	= 300;

	Core3D::CreationFlags kCreateFlags;
	kCreateFlags.strWindowTitle = _T("DisplacedSphere");
	kCreateFlags.hIcon			= ::LoadIcon(::GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON1));
	kCreateFlags.uiWindowWidth	= uiWidth;
	kCreateFlags.uiWindowHeight = uiHeight;
	kCreateFlags.bWindowed		= true;

	App kApp;
	if(false == kApp.Initialize(kCreateFlags)) {return 1;}
	return kApp.Run();
}
Exemple #15
0
int
main(int argc, char** argv)
{
	App app;
	if (argc < 2 || strcmp(argv[1], "--addon-host") != 0) {
		BAlert* alert = new BAlert("Cortex AddOnHost",
			"This program runs in the background, and is started automatically "
			"by Cortex when necessary.  You probably don't want to start it manually.",
			"Continue", "Quit");
		alert->SetShortcut(1, B_ESCAPE);
		int32 response = alert->Go();

		if(response == 1)
			return 0;
	}
	app.Run();
	return 0;
}
Exemple #16
0
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;
};
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;
}
Exemple #18
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;
}
Exemple #19
0
int main(int argc, char* argv[])
#endif
{
    setlocale(LC_NUMERIC, "C");

    std::stringstream dummy;
    PATHMANAGER::Init(dummy, dummy);

    ///  open Log file
    //----------------------------------------------------------------
    std::string logfilename = PATHMANAGER::GetLogDir() + "/log.txt";
    std::ofstream logfile(logfilename.c_str());
    if (!logfile)
    {
        std::cerr << "Couldn't open log file: " << logfilename << std::endl;
        return EXIT_FAILURE;
    }

    //  set up logging arrangement
    logging::splitterstreambuf infosplitter(std::cout, logfile);
    std::ostream infosplitterstream(&infosplitter);
    logging::splitterstreambuf errorsplitter(std::cerr, logfile);
    std::ostream errorsplitterstream(&errorsplitter);
    logging::logstreambuf infolog("INFO: ", infosplitterstream);	//logstreambuf infolog("INFO: ", logfile);
    logging::logstreambuf errorlog("ERROR: ", errorsplitterstream);

    //  primary logging ostreams
    std::ostream info_output(&infolog);
    std::ostream error_output(&errorlog);/**/


    ///  Load Settings
    //----------------------------------------------------------------
    SETTINGS* settings = new SETTINGS();
    std::string setFile = PATHMANAGER::GetSettingsFile();

    if (!PATHMANAGER::FileExists(setFile))
    {
        info_output << "Settings not found - loading defaults." << std::endl;
        LoadDefaultSet(settings,setFile);
    }
    settings->Load(setFile);  // LOAD
    if (settings->version != SET_VER)  // loaded older, use default
    {
        info_output << "Settings found, but older version - loading defaults." << std::endl;
        LoadDefaultSet(settings,setFile);
        settings->Load(setFile);  // LOAD
    }

    // HACK: we initialize paths a second time now that we have the output streams
    PATHMANAGER::Init(info_output, error_output);


    ///  Game start
    //----------------------------------------------------------------
    GAME* pGame = new GAME(info_output, error_output, settings);
    std::list <std::string> args;//(argv, argv + argc);
    pGame->Start(args);  //game.End();

    App* pApp = new App();
    pApp->pSet = settings;
    pApp->pGame = pGame;
    pGame->pOgreGame = pApp;

    try
    {
        if (settings->multi_thr > 0)
            boost::thread t(VprThread, pApp);

#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
        pApp->Run( settings->ogre_dialog || lpCmdLine[0]!=0 );  //Release change-
#else
        pApp->Run( settings->ogre_dialog);
#endif
    }
    catch (Ogre::Exception& e)
    {
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
        MessageBoxA( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
        std::cerr << "An exception has occured: " << e.getFullDescription().c_str() << std::endl;
#endif
    }

    info_output << "Exiting" << std::endl;
    delete pApp;
    delete pGame;
    delete settings;
    return 0;
}
Exemple #20
0
void main()
{
	App* app = new PhysXApp();
	app->Run();
}
Exemple #21
0
	int main(int argc, char* argv[])
#endif
{
#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
	//XInitThreads();
#endif
	
	setlocale(LC_NUMERIC, "C");

	PATHMANAGER::Init(std::cout, std::cerr);


	std::streambuf* oldCout = std::cout.rdbuf();
	std::streambuf* oldCerr = std::cerr.rdbuf();

	#if 0
    std::string po = PATHMANAGER::UserConfigDir() + "/ogre_ed.out";
    std::ofstream out(po.c_str());
    std::cout.rdbuf(out.rdbuf());  // redirect std::cout to out.txt
    #endif

	#if 1
    std::string pa = PATHMANAGER::UserConfigDir() + "/ogre_ed.err";
    std::ofstream oute(pa.c_str());
    std::cerr.rdbuf(oute.rdbuf());  // redirect std::cerr to oute.txt
    #endif
	

	///  Load Settings
	//----------------------------------------------------------------
	SETTINGS* settings = new SETTINGS();
	std::string setFile = PATHMANAGER::EditorSetFile();

	if (!PATHMANAGER::FileExists(setFile))
	{
		std::cout << "Settings not found - loading defaults." << std::endl;
		LoadDefaultSet(settings,setFile);
	}
	settings->Load(setFile);  // LOAD
	if (settings->version != SET_VER)  // loaded older, use default
	{
		std::cout << "Settings found, but older version - loading defaults." << std::endl;
		boost::filesystem::rename(setFile, PATHMANAGER::UserConfigDir() + "/editor_old.cfg");
		LoadDefaultSet(settings,setFile);
		settings->Load(setFile);  // LOAD
	}


	//  Start
	//----------------------------------------------------------------
	App* pApp = new App(settings);

	try
	{
		#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
			pApp->Run( settings->ogre_dialog || lpCmdLine[0]!=0 );
		#else
			pApp->Run( settings->ogre_dialog );
		#endif
	}
	catch (Ogre::Exception& e)
	{
		#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
			MessageBoxA( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
		#else
			std::cerr << "An exception has occured: " << e.getFullDescription().c_str() << std::endl;
		#endif
	}

	pApp->SaveCam();
	delete pApp;
	
	settings->Save(setFile);
	delete settings;

	std::cout.rdbuf(oldCout);
	std::cerr.rdbuf(oldCerr);

	return 0;
}
Exemple #22
0
int main()
{
	App app;
	app.Run();
}
Exemple #23
0
int main(int argc, char *argv[])
{
	App *app = new App();
	
	if (app)
	{
		if (app->win)
		{
			SimpleListView<BListView> *list = new SimpleListView<BListView>(app->win->Bounds(), "list");
//			SimpleListView *list = new SimpleListView(app->win->Bounds(), "list");
			
			if (list)
			{		
				EditableListItem *item = new EditableListItem("test 1");
				item->SetHeight(40);
				item->SetTextPosition(BPoint(40, 20));
				item->SetEditable();
				list->AddItem(item);
				
				list->AddItem(item = new EditableListItem("test 2"));
				item->SetHeight(40);
				item->SetTextPosition(BPoint(10, 10));
				
				list->AddItem(item = new EditableListItem("test 3"));
				item->SetHeight(40);
				item->SetTextPosition(BPoint(10, 10));
				
				list->AddItem(item = new EditableListItem("test 4"));
				item->SetHeight(40);
				item->SetTextPosition(BPoint(10, 10));
				
				list->AddItem(item = new EditableListItem("test 5"));
				item->SetHeight(40);
				item->SetTextPosition(BPoint(10, 10));
				item->SetEditable();
				
				list->AddItem(item = new EditableListItem("test 6"));
				item->SetHeight(40);
				item->SetTextPosition(BPoint(10, 10));

				BitmapListItem *bitmapListItem;

				list->AddItem(bitmapListItem = new BitmapListItem("Bitmap Test"));
				bitmapListItem->SetHeight(40);
				bitmapListItem->SetTextPosition(BPoint(45, 10));
				bitmapListItem->SetEditable();
				
				BBitmap *bitmap = BTranslationUtils::GetBitmapFile("../Cat_and_Fly");
				bitmapListItem->SetBitmap(bitmap, BRect(), true);

				list->AddItem(item = new EditableListItem("test 7"));
				item->SetHeight(40);
				item->SetTextPosition(BPoint(10, 10));

				list->AddItem(bitmapListItem = new BitmapListItem("Bitmap Test 2"));
				bitmapListItem->SetHeight(49);
				bitmapListItem->SetTextPosition(BPoint(50, 10));
				bitmapListItem->SetEditable();
				
				bitmap = BTranslationUtils::GetBitmapFile("../Cat_and_Fly");
				bitmapListItem->SetBitmap(bitmap, BRect(), true);
				
				
				list->SetViewColor(167, 68, 190);
				app->win->AddChild(list);				
			}
		}
		
		app->Run();
		delete app;
	}
	
	return 0;
}