int main(int argc, char *argv[], char *envp[]) { Application app; Application_Init(&app, argc, argv, envp); int ret = ExitStatus_Success; try { ret = Application_Run(&app) ? ExitStatus_Success : ExitStatus_Failure; } catchAny { Exception_Print(e); #if Exception_SaveTrace Backtrace_PrintTrace( Exception_GetTraceBuffer(), Exception_GetTraceLength()); #endif ret = ExitStatus_Failure; } finally { Application_Destroy(&app); } tryEnd; return ret; }
int main(int argc, char** argv) { bootstrap(); SDL_assert(globalApplication); SDL_assert(globalApplication->initialize); SDL_assert(globalApplication->loop); SDL_assert(globalApplication->cleanup); SDL_assert((globalApplication->initialize(globalApplication, argc, argv))); globalApplication->loop(globalApplication); int result = globalApplication->cleanup(globalApplication); Application_Destroy(globalApplication); globalApplication = 0; return result; }