Exemplo n.º 1
0
int main( int argc, char* argv[] )
{
 	TestApp* pcTest = new TestApp();
	pcTest->Run();

	return( 0 );
}
Exemplo n.º 2
0
int main(int argc, char **argv)
{
  TestApp app;

  srand((unsigned int)time(NULL));

  if(argc > 1)
  {
    app.set_num_verts(atoi(argv[1]));
  }

  float x = remap_range(0.3f, 0.0f, 1.0f, -10.0f, 10.0f);
  cout<<"remap: "<<x<<endl;

  //app.init();
  //app.run();

  Matrix4x4 mat(3.0f, 7.0f, 2.0f, 5.0f,
                1.0f, 8.0f, 4.0f, 2.0f,
                2.0f, 1.0f, 9.0f, 3.0f,
                5.0f, 4.0f, 7.0f, 1.0f);
  Matrix4x4 inv = mat;
  inv.invert();

  Matrix4x4 ident = mat * inv;

  return 0;
}
Exemplo n.º 3
0
int main() {
    TestApp app;

    app.init();
    app.run();

    return 0;
}
Exemplo n.º 4
0
INT WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE, LPTSTR, INT)
{
	TestApp app;

	app.Setup(hInst);

   return app.Run();
}
Exemplo n.º 5
0
	static int main(const std::vector<std::string> &args)
	{
		SetupCore setup_core;

		// Start the Application
		TestApp app;
		int retval = app.main(args);
		return retval;
	}
Exemplo n.º 6
0
	static int main(const std::vector<std::string> &args)
	{
		SetupCore setup_core;
		SetupDisplay setup_display;
		SetupD3D setup_d3d;

		TestApp app;
		return app.main(args);
	}
Exemplo n.º 7
0
// main function
int main()
{
  setlocale(LC_ALL, "");

  TestApp *app = TestApp::Instance();
  app->Run();

  return 0;
}
Exemplo n.º 8
0
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	TestApp* tApp = new TestApp(hInstance);

	if(!tApp->Init())
		return 1;

	return tApp->Run();
}
Exemplo n.º 9
0
	static int main(const std::vector<std::string> &args)
	{
		// Initialize ClanLib base components
		SetupCore setup_core;

		// Start the Application
		TestApp app;
		int retval = app.main(args);
		return retval;
	}
Exemplo n.º 10
0
int main()
{
	TestApp app;

	app.init();
	app.play();
	app.term();

	return 0;
}
Exemplo n.º 11
0
	static int main(const std::vector<CL_String> &args)
	{
		CL_SetupCore setup_core;
		CL_SetupDisplay setup_display;
		CL_SetupGL setup_gl;

		// Start the Application
		TestApp app;
		int retval = app.main(args);
		return retval;
	}
Exemplo n.º 12
0
int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{
	TestApp app;
	app.Initialize();
	app.Run();
	app.Finalize();
	
	return 0;
}
// main
int
main(int argc, char **argv)
{
	// find app file and get signature from resources
	char path[B_PATH_NAME_LENGTH];
	status_t error = get_app_path(path);
	char signature[B_MIME_TYPE_LENGTH];
	if (error == B_OK) {
		// init app file
		BFile file;
		error = file.SetTo(path, B_READ_ONLY);
		// get signature
		BString signatureString;
		if (error == B_OK) {
			if (file.ReadAttrString("signature", &signatureString) == B_OK
				&& signatureString.Length() > 0) {
				strcpy(signature, signatureString.String());
			} else
				strcpy(signature, kDefaultTestAppSignature);
		} else
			printf("ERROR: Couldn't init app file: %s\n", strerror(error));
	} else
		printf("ERROR: Couldn't get app ref: %s\n", strerror(error));
	// create the app
	TestApp *app = NULL;
	if (error == B_OK) {
		app = new TestApp(signature);
//		unitTesterMessenger = BMessenger(kUnitTesterSignature);
		error = init_unit_tester_messenger();
		if (error != B_OK)
			printf("ERROR: Couldn't init messenger: %s\n", strerror(error));
		// send started message
		BMessage message(MSG_STARTED);
		message.AddString("path", path);
		unitTesterMessenger.SendMessage(&message);
		// send main() args message
		BMessage argsMessage(MSG_MAIN_ARGS);
		argsMessage.AddInt32("argc", argc);
		for (int i = 0; i < argc; i++)
			argsMessage.AddString("argv", argv[i]);
		unitTesterMessenger.SendMessage(&argsMessage);
		// run the app
		app->Run();
		delete app;
		// send terminated message
		unitTesterMessenger.SendMessage(MSG_TERMINATED);
	}
	return 0;
}
Exemplo n.º 14
0
	static int main(const std::vector<std::string> &args)
	{
		SetupCore setup_core;
		SetupDisplay setup_display;

#ifdef USE_D3D
		SetupD3D setup_d3d;
#else
		SetupGL setup_gl;
#endif

		// Start the Application
		TestApp app;
		int retval = app.main(args);
		return retval;
	}
Exemplo n.º 15
0
int
main(int argc, char **argv)
{
  using namespace StarEngine;

  TestApp *app;
  int ret = -1;

  try {
    app = new TestApp();
    ret = app->run();
  } catch(Exception *e) {
    e->show();
  }

  return ret;
}
Exemplo n.º 16
0
	virtual void SetUp() {
		char appname[] = "ClockTest.o";
		int argc = 1;
		char *argv[1] = { appname };
		app = new TestApp();
		wxApp::SetInstance(app);
		wxEntryStart(argc, argv);
		app->OnInit();
	}
Exemplo n.º 17
0
int main() {
    TestApp app;
    int i;
    bool q = false;

    while(q == false) {
        scanf("%d", &i);
        switch(i) {
            case 1://ユビプレイ
                app.play();
                break;
            case 2://ユビポーズ
                app.pause();
                break;
            case 3://ユビストップ
                app.stop();
                break;
            case 4://ユビシンク
                app.sync();
                break;
            case 5://ユビサーチ
                app.search();
                break;
            case 9:
                q = true;
                break;
            default:
                break;
        }
    }
    return 0;
}
Exemplo n.º 18
0
 void Test::Run()
 {
     m_result = true;
     try
     {
         TestApp* app = new TestApp;
         Punk::Config cfg;
         cfg.gpu_config.view_width = 800;
         cfg.gpu_config.view_height = 600;
         app->Init(cfg);
         System::Mouse::Instance()->LockInWindow(false);
         app->Run();
         delete app;
     }
     catch(System::PunkException& e)
     {
         out_error() << e.ToString() << std::endl;
         m_result = false;
     }
     catch(...)
     {
         m_result = false;
     }
 }
Exemplo n.º 19
0
// main function
int main()
{
  setlocale(LC_ALL, "");

  // initialize CppConsUI
  int consui_res = CppConsUI::initializeConsUI();
  if (consui_res) {
    fprintf(stderr, "CppConsUI initialization failed.\n");
    return consui_res;
  }

  TestApp *app = new TestApp;
  app->run();
  delete app;

  // finalize CppConsUI
  consui_res = CppConsUI::finalizeConsUI();
  if (consui_res) {
    fprintf(stderr, "CppConsUI deinitialization failed.\n");
    return consui_res;
  }

  return 0;
}
Exemplo n.º 20
0
	virtual void TearDown() {
		app->OnExit();
		wxEntryCleanup();
	}
Exemplo n.º 21
0
int main(int argc,char**argv)
#endif
{
	// FIXME: in the future we will call a static method on TouchScreenDevice
	// in order to get an ITouchScreen (singleton pattern) as opposed to directly
	// creating it here.. 

	ITouchScreen *screen = TouchScreenDevice::getTouchScreen();
	TestApp app;


	char* configFileName = "config.xml";
	if(!screen->loadConfig(configFileName))
	{
		screen->pushFilter("cvcapture", "capture1");
		screen->pushFilter("mono", "mono2");
		screen->pushFilter("smooth", "smooth3");
		screen->pushFilter("backgroundremove", "background4");

		screen->pushFilter("brightnesscontrast", "bc5");
		screen->pushFilter("rectify", "rectify6");
		//I can't figure out a better way to pass in the string than to create
		//a var first because the prototype is using a reference. Just passing
		//a cstring fails on gcc  
		std::string rectify6 = "rectify6";
		screen->setParameter(rectify6, "level", "25");
		std::string capture1 = "capture1";
		screen->setParameter(capture1, "source", "cam");
		//screen->setParameter("capture1", "source", "../tests/simple-2point.avi");
		//screen->setParameter("capture1", "source", "../tests/hard-5point.avi");
		std::string bc5 = "bc5";
		screen->setParameter(bc5, "brightness", "0.1");
		screen->setParameter(bc5, "contrast", "0.4");

		screen->saveConfig(configFileName);
	}

	screen->registerListener((ITouchListener *)&app);

	// Note: Begin processing should only be called after the screen is set up
	screen->beginProcessing();

	bool ok=true;
	do
	{
		screen->getEvents();
		app.draw();
		//printf("*");
		int keypressed = (cvWaitKey(10) & 255);

        if(keypressed  == 27 ) break;

        if( keypressed == 98)				// b = recapture background
		{
			std::string background4 = "background4";
			screen->setParameter(background4, "capture", "");
		}
	} while( 1 );

	screen->saveConfig(configFileName);
	TouchScreenDevice::destroy();
	return 0;
}
Exemplo n.º 22
0
int main(int argc, char** argv)
{
	TestApp program;
	program.main();
}
Exemplo n.º 23
0
//------------------------------------------------------------------------------ 
// main 
//------------------------------------------------------------------------------ 
// Uppgift: Main start för programmet.
// Indata : (void)
// Utdata : (void)
//------------------------------------------------------------------------------
int main() {
	TestApp testApp;
	testApp.run();
	system("pause");
}
Exemplo n.º 24
0
void fork_clients(int client_NUM, uint32_t tkcc)
{

TKCC=tkcc;

intitalize_msgs();
//cout<< "total clients are:"<<client_NUM<<endl;
	for (int i=0; i<client_NUM; i++)
	{
			 int pid= fork();

			if (pid==-1)
			{
				cout<< "not able to fork\n";
			}

			else if (pid==0)
			{

				//pid_t pid_child= getpid();
				//cout <<" in child" << i <<"  pid is "<< pid_child<<"\n";

///////////////////////////////////////////////////////////////////
// get the PORT to connect on through shared memory and populate struct to
	//talk to manager through TCP on: address_client, sockfd_client
///////////////////////////////////////////////////////////////////


				int numbytes_client;
				struct sockaddr_in address_client;
				int  addresslen_client = sizeof(address_client);

				address_client.sin_family = AF_INET;
				address_client.sin_port = PORT;
				address_client.sin_addr.s_addr = INADDR_ANY;
				if ((sockfd_client = socket(AF_INET,SOCK_STREAM,0)) == -1)
				{
					perror("client: socket");
				}
				if (connect(sockfd_client, (struct sockaddr*)&address_client, addresslen_client) == -1)
				{
					close(sockfd_client);
					perror("client: connect");
				}

///////////////////////////////////////////////////////////////////
				//starting to recieve boot info from manager
///////////////////////////////////////////////////////////////////
				getsockname(sockfd_client,(struct sockaddr *)&address_client, (socklen_t*)&addresslen_client);

				// receiving the nonce from manager
				if ((numbytes_client = recv(sockfd_client, NONCE, sizeof NONCE, 0)) == -1)
				{
					perror("recv_NONCE");
					exit(1);
				}
				NONCE[numbytes_client] = '\0';
				//outfile_client<<"received nonce:"<<NONCE<<endl;

				// receiving the client name from manager
				if ((numbytes_client = recv(sockfd_client, CLIENT_NAME, sizeof CLIENT_NAME, 0)) == -1)
				{
					perror("recv_NAME");
					exit(1);
				}
				CLIENT_NAME[numbytes_client] = '\0';
				char client_name[100];
				strcpy(client_name,CLIENT_NAME);
				 MY_TOKEN=nonce_name_hash(uint32_t(htonl(atoi(NONCE))), client_name);
				//c<<"hash is ------------"<<hex<<MY_TOKEN<<endl;

				string file_name= "stage"+STAGE+"."+(string)CLIENT_NAME+".out";
				outfile_client.open(str_to_char(file_name));

				outfile_client<<"client "<<CLIENT_NAME<<" created with hash "<<hex<<MY_TOKEN<<endl;
				//outfile_client<<"received the host name from manager:"<<CLIENT_NAME<<endl;


				// receiving the FP from manager
				if ((numbytes_client = recv(sockfd_client, FP, sizeof FP, 0)) == -1)
				{
					perror("recvFP");
					exit(1);
				}
				FP[numbytes_client] = '\0';
				//outfile_client<<"received FP:"<<dec<<FP<<endl;

				// receiving the FS from manager
				if ((numbytes_client = recv(sockfd_client, FS, sizeof FS, 0)) == -1)
				{
					perror("recvFS");
					exit(1);
				}
				FS[numbytes_client] = '\0';
				//outfile_client<<"received FS:"<<FS<<endl;
				//int client_nonce = atoi(buf_client);


////////////////////////////////////////////////////////////////////
// creating a UDP socket for triad messages- UDP_private
////////////////////////////////////////////////////////////////////
				create_main_udp_port();

////////////////////////////////////////////////////////////////////
// creating a UDP socket for hello messages- UDP_hello
////////////////////////////////////////////////////////////////////
				create_hello_udp_port();
				create_lazy_udp_port();

						//printf("DGRAM port is : %d\n",DGRAM_PORT);
						//outfile_client<< "my udp port is : "<<dec<<DGRAM_PORT<<endl;
//////////////////////////////////////////////
//	finding position in the ring
//////////////////////////////////////////////

						if ((STAGE.compare("2")==0) || (STAGE.compare("3")==0))
						{
							position_in_ring();
						}
						else if((STAGE.compare("6")==0) || (STAGE.compare("7")==0))
						{//cout<<" inside the right intializer"<<endl;
							position_in_ring_FT();
						}

////////////////////////////////////////////////////////////////////////////////////////////
//	sending dgram port and NONCE+Sx to manager through tcp socket - sockfd_client
////////////////////////////////////////////////////////////////////////////////////////////

				sprintf(buf,"%d",DGRAM_PORT);
				if(send(sockfd_client, buf, sizeof(buf), 0) == -1)
					 perror("send");
				//outfile_client<<"dgram port sent is:"<<dec<<DGRAM_PORT<<endl;

				char q[100];
				strcpy (q,NONCE);
				strcat (q,client_name);

				if(send(sockfd_client, q, sizeof(q), 0) == -1)
				perror("send");
				//outfile_client<<"concat nonce+Sx sent is:"<<dec<<q<<endl;



//////////////////////////////////////////////////////////////////////////
				// SELECT between the TCP and UDP sockets
//////////////////////////////////////////////////////////////////////////

				//SELECT();

				TestApp *app;
				app = new TestApp;
					 //Start the timers
					app->start();


				close(sockfd_client);
				outfile_client.close();
				//outfile_client.close();
				exit(0);	//once the child is done sending the info kill the child
			}  // end child code
	}  // end for loop
} // end function