33 lines
602 B
C++
33 lines
602 B
C++
#include "Application.h"
|
|
|
|
#include <iostream>
|
|
#include <csignal>
|
|
|
|
#include "Config.h"
|
|
|
|
gln::Application app;
|
|
|
|
void terminate(int param) {
|
|
app.stop();
|
|
}
|
|
|
|
int main(int argc, const char **argv) {
|
|
gln::Config config;
|
|
config.load(argc, argv);
|
|
try {
|
|
::signal(SIGTERM, terminate);
|
|
app.setMaster(true);
|
|
app.initialize(config);
|
|
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;
|
|
}
|
|
}
|