Zappy GUI
C++ graphic client: renderer, camera, network
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1
#include <csignal>
2
#include <iostream>
3
4
#include "
core/App.hpp
"
5
6
volatile
sig_atomic_t
g_interrupted
= 0;
7
8
static
void
onInterrupt
(
int
) {
g_interrupted
= 1; }
9
10
int
main
(
int
argc,
char
** argv)
11
{
12
signal(SIGPIPE, SIG_IGN);
13
signal(SIGINT,
onInterrupt
);
14
signal(SIGTERM,
onInterrupt
);
15
16
App
app(argc, argv);
17
18
if
(!app.
shouldRun
()) {
19
return
app.
exitCode
();
20
}
21
22
try
{
23
app.
run
();
24
}
catch
(
const
std::exception& e) {
25
std::cerr <<
"[Fatal] "
<< e.what() <<
"\n"
;
26
return
1;
27
}
catch
(...) {
28
std::cerr <<
"[Fatal] Unknown exception\n"
;
29
return
1;
30
}
31
return
0;
32
}
App.hpp
App
The main application class that manages the game state, network communication, and rendering....
Definition
App.hpp:17
App::shouldRun
bool shouldRun() const
Checks if the application should run based on the parsed arguments.
Definition
App.cpp:24
App::exitCode
int exitCode() const
Gets the exit code to return if the application should not run.
Definition
App.cpp:26
App::run
void run()
Runs the application.
Definition
App.cpp:28
g_interrupted
volatile sig_atomic_t g_interrupted
Definition
main.cpp:6
main
int main(int argc, char **argv)
Definition
main.cpp:10
onInterrupt
static void onInterrupt(int)
Definition
main.cpp:8
gui
src
main.cpp
Generated by
1.9.8