46 lines
1.0 KiB
C++
46 lines
1.0 KiB
C++
#include <boost/stacktrace.hpp>
|
|
#include <spdlog/spdlog.h>
|
|
#include <spdlog/sinks/stdout_color_sinks.h>
|
|
#include "gui/window.hpp"
|
|
#include "gui/menu/menu_data.hpp"
|
|
#include "gui/gui_data.hpp"
|
|
#include "gui/gui.hpp"
|
|
#include "controller.hpp"
|
|
#include "character_sheet.hpp"
|
|
|
|
void myTerminateHandler() {
|
|
try {
|
|
SPDLOG_CRITICAL(to_string(boost::stacktrace::stacktrace()));
|
|
} catch (...) {}
|
|
std::abort();
|
|
}
|
|
|
|
int main() {
|
|
std::set_terminate(myTerminateHandler);
|
|
std::ios::sync_with_stdio(false);
|
|
spdlog::set_default_logger(spdlog::stdout_color_st("console"));
|
|
|
|
try {
|
|
gui::Window window;
|
|
character::CharacterSheet billy;
|
|
gui::GuiData gui_data(window, billy);
|
|
gui::menu::MenuData menu_data(billy);
|
|
Controller controller(billy, menu_data);
|
|
gui::Gui gui(gui_data, menu_data);
|
|
|
|
while (!window.should_close()) {
|
|
glfwPollEvents();
|
|
controller.control();
|
|
|
|
gui.render_gui();
|
|
gui.render_gpu();
|
|
|
|
window.swap_buffers();
|
|
}
|
|
} catch (const std::exception &e) {
|
|
SPDLOG_CRITICAL(e.what());
|
|
return EXIT_FAILURE;
|
|
}
|
|
return EXIT_SUCCESS;
|
|
}
|