2011-01-14 14:59:18 +01:00
|
|
|
#include "Application.h"
|
|
|
|
|
|
|
|
#include <iostream>
|
2011-01-16 23:02:40 +01:00
|
|
|
#include <csignal>
|
2011-01-14 14:59:18 +01:00
|
|
|
|
2011-01-16 23:02:40 +01:00
|
|
|
Application app;
|
|
|
|
|
|
|
|
void terminate(int param) {
|
|
|
|
app.stop();
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, const char **argv) {
|
|
|
|
Arguments args(argc, argv);
|
2011-01-14 14:59:18 +01:00
|
|
|
try {
|
2011-01-16 23:02:40 +01:00
|
|
|
::signal(SIGTERM, terminate);
|
2011-01-14 21:09:14 +01:00
|
|
|
app.setMaster(true);
|
2011-01-16 23:02:40 +01:00
|
|
|
app.initialize(args);
|
2011-01-14 14:59:18 +01:00
|
|
|
while (app.isRunning())
|
|
|
|
app.update();
|
|
|
|
app.shutdown();
|
|
|
|
return 0;
|
|
|
|
} catch (const char *str) {
|
|
|
|
std::cerr << "Exception: " << str << std::endl;
|
|
|
|
return 1;
|
|
|
|
} catch (const std::exception &e) {
|
|
|
|
std::cerr << "Exception: " << e.what() << std::endl;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|