TEST_F(TestSceneManager, changeScene) { MyApp manager; manager.add<Title>("Title"); manager.add<Game>("Game"); manager.changeScene("Game"); EXPECT_EQ(manager.getState(), "Game"); }
int main(int argc, char **argv) { KLocale::setMainCatalogue("korganizer"); KAboutData aboutData("korgac", I18N_NOOP("KOrganizer Reminder Daemon"), korgacVersion, I18N_NOOP("KOrganizer Reminder Daemon"), KAboutData::License_GPL, "(c) 2003 Cornelius Schumacher", 0, "http://pim.kde.org"); aboutData.addAuthor("Cornelius Schumacher", I18N_NOOP("Maintainer"), "*****@*****.**"); aboutData.addAuthor("Reinhold Kainhofer", I18N_NOOP("Maintainer"), "*****@*****.**"); KCmdLineArgs::init(argc, argv, &aboutData); KCmdLineArgs::addCmdLineOptions(options); KUniqueApplication::addCmdLineOptions(); if(!MyApp::start()) exit(0); MyApp app; app.disableSessionManagement(); KGlobal::locale()->insertCatalogue("libkcal"); return app.exec(); }
TEST_F(TestSceneManager, init) { MyApp manager; manager.add<Title>("Title"); manager.add<Game>("Game"); manager.init("Game"); EXPECT_EQ(manager.getState(), "Game"); }
int main(){ MyApp app; app.start(); return 0; }
int main() { MyApp app; while(running){ app.onFrame(); usleep(1); } return 0; }
int main(int argc, char** argv) { MyApp app; if (!app.init(&argc, argv)) return 1; app.run(); return 0; }
int main() { MyApp *app = new MyApp(); app->Run(); delete app; return 0; }
int main( int argc, char** argv ) { Feel::Environment env( _argc=argc,_argv=argv,_desc=makeOptions(),_about=makeAbout() ); MyApp myapp; myapp.run(); }
int main(int argc, char **argv) { static KCmdLineOptions options[] = { {"show", I18N_NOOP("Show window on startup"), 0}, {"kwalletd", I18N_NOOP("For use by kwalletd only"), 0}, {"+name", I18N_NOOP("A wallet name"), 0}, KCmdLineLastOption }; KAboutData about("kwalletmanager", I18N_NOOP("KDE Wallet Manager"), "1.1", I18N_NOOP("KDE Wallet Management Tool"), KAboutData::License_GPL, I18N_NOOP("(c) 2003,2004 George Staikos"), 0, "http://www.kde.org/"); about.addAuthor("George Staikos", I18N_NOOP("Primary author and maintainer"), "*****@*****.**"); about.addAuthor("Isaac Clerencia", I18N_NOOP("Developer"), "*****@*****.**"); KCmdLineArgs::init(argc, argv, &about); KCmdLineArgs::addCmdLineOptions(options); if (!KUniqueApplication::start()) { return 0; } MyApp a; KWalletManager wm; wm.setCaption(i18n("KDE Wallet Manager")); a.setMainWidget(&wm); KGlobal::dirs()->addResourceType("kwallet", "share/apps/kwallet"); KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); if (args->isSet("show")) { wm.show(); } if (args->isSet("kwalletd")) { wm.kwalletdLaunch(); } for (int i = 0; i < args->count(); ++i) { QString fn = QFileInfo(args->arg(i)).absFilePath(); KMimeType::Ptr ptr; if (QFile::exists(fn) && (ptr = KMimeType::findByFileContent(fn)) && ptr->is("application/x-kde-wallet")) { wm.openWalletFile(fn); } else { wm.openWallet(args->arg(i)); } } args->clear(); return a.exec(); }
int main(int argc, char** argv) { MyApp app; app.setConfig("config.json"); app.setDesign("selection/Design.json"); if (!app.init(&argc, argv)) return 1; app.run(); return 0; }
int main() { MyApp* pcMyApp; qInstallMsgHandler( print_msg ); pcMyApp = new MyApp( "application/x-vnd.Procton-beabrowse" ); pcMyApp->Run(); return( 0 ); }
int main() { MyApp app; try { app.fail(); }catch(MyApp::Trouble& e) { puts("Handled Trouble"); }catch(MyApp::Small& e) { puts("Handled Small"); }catch(MyApp::Big& e) { puts("Handled Big"); } return 0; }
void TestClearBuffer::Run() { MyApp app; try { app.Init(Punk::Config()); System::Mouse::Instance()->LockInWindow(false); app.Run(); } catch(...) { m_result = false; } }
int main( int argc, char ** argv ) { int c; int nNameLen = strlen( argv[0] ); if ( nNameLen >= 5 && strcasecmp( argv[0] + nNameLen - 5, "pulse" ) == 0 ) { g_bBarView = true; } while( (c = getopt_long (argc, argv, "hvfgb", long_opts, (int *) 0)) != EOF ) { switch( c ) { case 0: break; case 'h': g_nShowHelp = true; break; case 'v': g_nShowVersion = true; break; case 'f': sscanf( optarg, "%f,%f,%f,%f", &g_cWinRect.left,&g_cWinRect.top,&g_cWinRect.right,&g_cWinRect.bottom ); g_bWindowRectSet = true; break; case 'g': g_bBarView = false; break; case 'b': g_bBarView = true; break; default: usage( argv[0], false ); exit( 1 ); break; } } if ( g_nShowVersion ) { printf( "Syllable CPU Monitor 1.0\n" ); exit( 0 ); } if ( g_nShowHelp ) { usage( argv[0], true ); exit( 0 ); } MyApp* pcApp = new MyApp; pcApp->Run(); }
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { //glutInit(&__argc, __argv); //glutCreateWindow(__argv[0]); //glutDisplayFunc(display); //glutMainLoop(); //return 0; MyApp app; app.Init(hInstance, nCmdShow); app.Execute(); return 0; }
int main(int argc, const char * argv[]){ app.create( Window::Dim(800, 600), "Hopf Fibration"); MainLoop::start(); return 0; }
int main (int argc, char **argv) { KAboutData aboutData( "kfax", I18N_NOOP("KFax"), KFAXVERSION, description, KAboutData::License_GPL, "(c) 1997-98 Bernd Johannes Wuebben"); aboutData.addAuthor( "Bernd Johannes Wuebben", 0, "*****@*****.**" ); aboutData.addCredit( "Nadeem Hasan", I18N_NOOP( "UI Rewrite, lots of code " "cleanups and fixes" ), "*****@*****.**" ); aboutData.addCredit( "Helge Deller", I18N_NOOP( "Printing Rewrite, lots of code " "cleanups and fixes"), "*****@*****.**" ); KCmdLineArgs::init(argc, argv, &aboutData); KCmdLineArgs::addCmdLineOptions( options ); MyApp a; qtdisplay = qt_xdisplay(); viewfaxmain(); toplevel = new TopLevel(); toplevel->show(); startingup = 1; a.processEvents(); a.flushX(); startingup = 0; faxinit(); if(!have_no_fax){ thispage = firstpage; toplevel->newPage(); toplevel->resizeView(); //TODO : I don't think I need this putImage(); toplevel->putImage(); } toplevel->uiUpdate(); return a.exec (); }
int main(int argc, const char * argv[]){ app.create(Window::Dim(800, 600), "Allovsr Example: Robot Arm"); // app.create(Window::Dim(800, 600), "Allovsr Example: Robot Arm",60, Window::DEFAULT_BUF | Window::STEREO_BUF); MainLoop::start(); return 0; }
int main(int argc, const char * argv[]){ app.create(Window::Dim(800, 600), "Allovsr Example: Circle - Plane Intersection"); //app.description = "hello"; MainLoop::start(); return 0; }
TEST_F(MTK_Kokkos, calculate_centroid_field_with_gather_on_device_flat) { MyApp app; GpuGatherFlatScratchData scratch(app.choice); scratch.initialize(*app.bulk, *app.coords, app.centroid, app.meta.locally_owned_part()); CentroidCalculator<GpuGatherFlatScratchData> calculator(scratch); app.start_timer(); calculator.calculate_centroids(app.num_repeat, app.choice, app.teamSize); app.stop_timer(); app.report_bandwidth(); calculator.copy_centroids_to_host(); // calculator.test_centroid_of_element_1(); for(unsigned elementIndex=0; elementIndex<scratch.hostElemEntities.extent(0); ++elementIndex) { calculator.test_centroid_of_element(app.hostCentroid, scratch.hostElemEntities(elementIndex), elementIndex); } }
TEST_F(TestSceneManager, update) { MyApp manager; manager.add<Title>("Title"); manager.add<Game>("Game"); manager.update(); manager.update(); manager.update(); manager.update(); manager.update(); EXPECT_EQ(manager.get()->t, 5); manager.update(); EXPECT_EQ(manager.getState(), "Game"); }
int main() { LOG("main()"); MyApp app; app.start(); }
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); // TODO: Place code here. MSG msg; ZERO_OUT(msg); HACCEL hAccelTable; // Initialize global strings LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); LoadString(hInstance, IDC_SCENEVIEWER, szWindowClass, MAX_LOADSTRING); MyRegisterClass(hInstance); // Perform application initialization: if (!InitInstance (hInstance, nCmdShow)) { return FALSE; } hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_SCENEVIEWER)); SetupBaseUtil setupBase; FileLogUtil fileLog; SetupCoreUtil setupCore; SetupEngineUtil setupEngine; CConsole console(APP_TITLE); console.setTopLeft(0,0); MyApp app; #if 0 vector2d<int> resolution(800,600); vector2d<int> topLeftCorner(800,450); #else //vector2d<int> resolution(1024,768); vector2d<int> resolution(1400,900); vector2d<int> topLeftCorner(0,0); #endif GetMessage(&msg, NULL, 0, 0); { MyAppWindow appWindow( &app, msg.hwnd ); appWindow.bringToFront(); appWindow.setTopLeft( topLeftCorner.x, topLeftCorner.y ); g_pMainWindow = &appWindow; app.PreInit_CreateViewports( &appWindow ); GameTimer timer; UNDONE; if( !app.Initialize(MXC("???")) ) { return -1; } // Main message loop: while( true ) { BOOL bPendingMsg = FALSE; //if( appWindow.isActive() ) { bPendingMsg = ::PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ); } //else //{ // bPendingMsg = ::GetMessage( &msg, NULL, 0, 0 ); //} if( msg.message == WM_QUIT ) { break; } //if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) //{ // TranslateMessage(&msg); // DispatchMessage(&msg); //} if( bPendingMsg ) { TranslateMessage(&msg); DispatchMessage(&msg); } const F4 deltaSeconds = timer.TickFrame(); appWindow.Tick( deltaSeconds ); appWindow.Draw(); MX_PROFILE_INCREMENT_FRAME_COUNTER; mxSleepMilliseconds(1); } app.Shutdown(); } return (int) msg.wParam; }
int main(int argc,char *argv[]) { AGMain main; MyApp app; AntargisView *av=new AntargisView(0,AGRect(0,0,100,100),Pos3D(0,0,0)); int x,y,z; int w=64; int s=0; Terrain t(16,16); AGSurface ms; int test=4; if(argc>1) test=atoi(argv[1]); if(test==1) { ms=test1(); av->insert(new VoxelImage(ms,Pos3D(0,0,0))); } if(test==2) { ms=ball(); av->insert(new VoxelImage(ms,Pos3D(0,0,0))); } else if(test==3) { ms=getTerrain(t.getInfo(2,0)); av->insert(new VoxelImage(ms,Pos3D(0,0,0))); } else if(test==4) { ms=getTerrain(t.getInfo(1,0)); av->insert(new VoxelImage(ms,Pos3D(0,0,0))); ms=getTerrain(t.getInfo(2,0)); av->insert(new VoxelImage(ms,Pos3D(64,0,0))); ms=getTerrain(t.getInfo(1,1)); av->insert(new VoxelImage(ms,Pos3D(32,0,-32))); ms=getTerrain(t.getInfo(2,1)); av->insert(new VoxelImage(ms,Pos3D(64+32,0,-32))); } else if(test==5) { int x,y; for(int x=0;x<4;x++) for(int y=0;y<4;y++) { ms=getTerrain(t.getInfo(x,y)); av->insert(new VoxelImage(ms,Pos3D(x*64+(y%2)*32,0,-y*32))); } } else if(test==6) { SplineMap<float> m(16,16,50); SplineMap<float> gm(16,16,20); int w=64; VoxelView v(w,w*2,Pos3D(0,0,0),true); for(int x=0;x<w;x++) for(int z=0;z<w;z++) { float mx=x/16.0; float mz=z/16.0; float h=m.get(mx,mz); for(int y=0;y<h;y++) { float a=std::min(1.0f,h-y); // cdebug(a); v.set(Pos3D(x,y,z),Color(0xAA,0xAA,0,a)); } // grass above float gh=rand()%int(gm.get(mx,mz)); if(gh>0) for(int y=0;y<gh;y++) { float a=1.0f-(y/gh); // cdebug(a); v.set(Pos3D(x,y+h,z),Color(0,0xAA,0,a)); } } /* // small ball above for(int x=0;x<8;x++) for(int y=0;y<8;y++) for(int z=0;z<8;z++) { int mx=x-4; int my=y-4; int mz=z-4; if(sqrt(mx*mx+my*my+mz*mz)<4) v.set(Pos3D(x+10,y+40,z+20),Color(0xAA,0,0)); } */ av->insert(new VoxelImage(v.getSurface(),Pos3D(0,0,0))); } else if(test==7) { float v0=-20; float v1=60; float v2=60; float v3=-20; float v4=0; float v5=0; float v6=0; int x; SDL_Surface *s=getScreen().surface(); Color c(0,0,1); for(x=0;x<32;x++) { int y=spline2(x/32.0,v0,v1,v2);//,v3); sge_PutPixel(s,x,y+50,c.toColor(s)); } for(x=0;x<32;x++) { int y=spline2(x/32.0,v1,v2,v3);//,v4); sge_PutPixel(s,x+32,y+50,c.toColor(s)); } for(x=0;x<32;x++) { int y=spline2(x/32.0,v2,v3,v4);//,v5); sge_PutPixel(s,x+64,y+50,c.toColor(s)); } for(x=0;x<32;x++) { int y=spline2(x/32.0,v3,v4,v5);//,v6); sge_PutPixel(s,x+96,y+50,c.toColor(s)); } SDL_Flip(s); // SDL_Delay(1000); } else if(test==8) { float v0=-20; float v1=60; float v2=60; float v3=-20; float v4=0; float v5=0; float v6=0; int x; SDL_Surface *s=getScreen().surface(); Color c(1,0,1); for(x=0;x<32;x++) { int y=spline3(x/32.0,v0,v1,v2,v3); sge_PutPixel(s,x,y+50,c.toColor(s)); } for(x=0;x<32;x++) { int y=spline3(x/32.0,v1,v2,v3,v4); sge_PutPixel(s,x+32,y+50,c.toColor(s)); } for(x=0;x<32;x++) { int y=spline3(x/32.0,v2,v3,v4,v5); sge_PutPixel(s,x+64,y+50,c.toColor(s)); } for(x=0;x<32;x++) { int y=spline3(x/32.0,v3,v4,v5,v6); sge_PutPixel(s,x+96,y+50,c.toColor(s)); } SDL_Flip(s); // SDL_Delay(1000); } else if(test==9) { SplineMap<float> m(64,64,50); int w=64; VoxelView v(w,w*2,Pos3D(0,0,0),false); int z=0; for(int x=0;x<w;x++) { float h=20+x/16.0; for(int y=0;y<h;y++) { float a=std::min(1.0f,h-y); // if(a<1) if(a>0) { cdebug(a); v.set(Pos3D(x,y,z),Color(0xFF,0xFF,0xFF,a));//Color(0xAA*a,0xAA*a,0));//,a)); } } } av->insert(new VoxelImage(v.getSurface(),Pos3D(0,0,0))); } else if(test==10) { SDL_Surface *s=getScreen().surface(); for(int x=0;x<100;x++) { float h=20+x/16.0; for(int y=0;y<h;y++) { float a=std::min(1.0f,h-y); if(a>0) { sge_PutPixelAlpha(s,x,100-y,SDL_MapRGBA(s->format,0xFF,0xFF,0xFF,a*0xFF),a*0xFF); } } } SDL_Flip(s); SDL_Delay(1000); } else if(test==11 || test==12) { int w=8; SplineMap<float> m(POINTS_PER_TILE*(w+2),POINTS_PER_TILE*(w+2),40); SplineMap<float> gm(POINTS_PER_TILE*(w+2),POINTS_PER_TILE*(w+2),10); if(test==12) w=2; for(int y=0;y<w;y++) for(int x=0;x<w;x++) { int mx=x*(POINTS_PER_TILE); int my=y*(POINTS_PER_TILE/2); if(y&1) mx+=(POINTS_PER_TILE/2); av->insert(new VoxelImage(makeTerrainTile(m,gm,mx,my),Pos3D(mx*TILE_WIDTH/POINTS_PER_TILE,0,my*TILE_WIDTH/POINTS_PER_TILE))); } } else if(test==13) { AGSurface s=makeWaterTile(); av->insert(new VoxelImage(s,Pos3D(64,0,0))); av->insert(new VoxelImage(s,Pos3D(0,0,0))); av->insert(new VoxelImage(s,Pos3D(64+32,0,32))); av->insert(new VoxelImage(s,Pos3D(32,0,32))); av->insert(new VoxelImage(s,Pos3D(64+32,0,-32))); av->insert(new VoxelImage(s,Pos3D(32,0,-32))); } else if(test==14) { AGSurface s=makeWaterTile(); std::string ms=toPNG(s.surface()); s=fromPNG(ms); av->insert(new VoxelImage(s,Pos3D(64,0,0))); } app.setMainWidget(av); app.run(); }
int main(int argc, char **argv) { MyApp app; return app.run(argc, argv); }
int main() { MyApp app; app.templateMethod(); } ///:~
int main(){ app.initWindow(); app.lens().near(10).far(25); app.start(); return 0; }
int main(int argc, char* argv[]) { MyApp app; app.start(); }
int main() { MyApp app; app.initWindow(Window::Dim(600, 400), "imageTexture"); app.start(); }