Beispiel #1
0
int App_MainRun(int argc, char** argv)
{
	// Create app object

	g_app = g_createAppCallbacksFunc();
	if (!g_app)
	{
		fprintf(stderr, "Failed to create app callbacks. Did you set up DEFINE_APP(yourClassName) in your project?");
		return 1;
	}

	// Startup system

	App::StartupParams params;
	if (!g_app->OnStartup(argc - 1, (const char**) (argv + 1), g_systemInfo, params))
		return 2;
	if (!App_Startup(&params))
		return 3;

	// Init app

	if (!g_app->OnInit())
		return 4;

	// Run app

	g_quit = false;
	App_Run();

	// Deinit app

	g_app->OnDeinit();
	delete g_app;

	// Shutdown system

	App_Shutdown();

	return 0;
}
Beispiel #2
0
int main(int argc, char** argv)
{
	sceRtcGetCurrentTick( &fpsTickLast );
	tickResolution = sceRtcGetTickResolution();
	
	Gamepad gamepad;
	
	App_Initialize();
	
	timerTest.start();
	
	float nextUpdate = 0;
	
	while(1)
	{
		
		timerTest.update();
		(*mySceneMotion).evaluate(timerTest.getSeconds());

		App_Render();

		if(gamepad.Poll())
		{
			if(gamepad.ButtonDown(PSP_CTRL_TRIANGLE))
			{
				timerTest.paused(true);
			}
			
			if(gamepad.ButtonDown(PSP_CTRL_SQUARE))
			{
				timerTest.paused(false);
			}

			if(timerTest.paused())
			{
				if(fabs(gamepad.AnalogX()) > 0.1)
				{
					if(gamepad.ButtonDown(PSP_CTRL_RTRIGGER))
					{
						if(timerTest.getSeconds() - 0.5f > 0 || gamepad.AnalogX() > 0)	timerTest.setSeconds(timerTest.getSeconds() + (gamepad.AnalogX() * 0.5));
					}
					else
					{
						if(timerTest.getSeconds() - 0.1f > 0 || gamepad.AnalogX() > 0)	timerTest.setSeconds(timerTest.getSeconds() + (gamepad.AnalogX() * 0.1));
					}
				}
			}
						
			if(gamepad.ButtonDown(PSP_CTRL_LEFT))
			{
				if(gamepad.ButtonDown(PSP_CTRL_RTRIGGER))
				{
					if(timerTest.getSeconds() - 0.1f > 0)	timerTest.setSeconds(timerTest.getSeconds() - 0.1);
				}
				else
				{
					if(timerTest.getSeconds() - 0.01f > 0)	timerTest.setSeconds(timerTest.getSeconds() - 0.01);
				}
			}
			
			if(gamepad.ButtonDown(PSP_CTRL_RIGHT))
			{
				if(gamepad.ButtonDown(PSP_CTRL_RTRIGGER))
				{
					timerTest.setSeconds(timerTest.getSeconds() + 0.1);
				}
				else
				{
					timerTest.setSeconds(timerTest.getSeconds() + 0.01);
				}
			}
		}		
	}

	App_Shutdown();

	return 0;
}