Ejemplo n.º 1
0
int main()
{
	VideoPtr video;
	BaseApplicationPtr application = CreateBaseApplication();

	if ((video = CreateVideo(480, 854, L"GS2D", true, true, L"assets/fonts/")))
	{
		InputPtr input = CreateInput(0, true);
		AudioPtr audio = CreateAudio(0);

		application->Start(video, input, audio);

		Video::APP_STATUS status;
		while ((status = video->HandleEvents()) != Video::APP_QUIT)
		{
			if (status == Video::APP_SKIP)
				continue;

			input->Update();
			application->Update(Min(static_cast<unsigned long>(1000), ComputeElapsedTime(video)));
			application->RenderFrame();
		}
	}
	application->Destroy();	

	#ifdef _DEBUG
	 #ifdef WIN32
	  _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
	  #endif
	#endif
	return 0;
}
Ejemplo n.º 2
0
JNIEXPORT jstring JNICALL Java_net_asantee_gs2d_GS2DJNI_destroy(JNIEnv* env, jobject thiz)
{
	application->Destroy();
	video->Message(GS_L("Application resources destroyed"), GSMT_INFO);
	g_globalVolume = audio->GetGlobalVolume();
	return env->NewStringUTF(GS_L(""));
}