-
Notifications
You must be signed in to change notification settings - Fork 1
/
Main.cpp
35 lines (29 loc) · 800 Bytes
/
Main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <exception>
#include <iostream>
#include "SDLW.hpp"
#include "Application.hpp"
#include "Renderer.hpp"
#include "Window.hpp"
namespace TappyPlane {
void run()
{
const SDLW::Subsystem sdlwGuard{SDLW::Subsystem::Flags::Video};
const SDLW::IMG::Subsystem imgGuard{SDLW::IMG::Subsystem::Flags::PNG};
Window::instance();
Renderer::instance();
Application app;
}
} // namespace TappyPlane
int main(int argc, char* argv[])
{
try {
TappyPlane::run();
} catch (const SDLW::Exception& e) {
std::cerr << "Uncaught SDLW exception: " << e.what() << '\n';
} catch (const std::exception& e) {
std::cerr << "Uncaught exception: " << e.what() << '\n';
} catch (...) {
std::cerr << "Unknown uncaught exception\n";
}
return 0;
}