2022-01-08 21:57:17 +01:00
|
|
|
#include <spdlog/spdlog.h>
|
2022-01-09 00:43:33 +01:00
|
|
|
#include <spdlog/sinks/stdout_color_sinks.h>
|
2022-01-11 22:33:29 +01:00
|
|
|
#include "gui/window.hpp"
|
2022-01-14 22:06:07 +01:00
|
|
|
#include "gui/menu/menu_data.hpp"
|
2022-01-11 22:33:29 +01:00
|
|
|
#include "gui/gui_data.hpp"
|
|
|
|
#include "gui/gui.hpp"
|
2022-01-17 22:00:26 +01:00
|
|
|
#include "controller.hpp"
|
|
|
|
#include "character_sheet.hpp"
|
2022-01-08 20:02:04 +01:00
|
|
|
|
|
|
|
int main() {
|
2022-01-08 21:57:17 +01:00
|
|
|
std::ios::sync_with_stdio(false);
|
2022-06-09 21:53:18 +02:00
|
|
|
spdlog::set_default_logger(spdlog::stdout_color_st("BillySheet"));
|
2022-01-09 00:43:33 +01:00
|
|
|
|
|
|
|
try {
|
2022-01-10 21:16:05 +01:00
|
|
|
gui::Window window;
|
2022-01-17 22:00:26 +01:00
|
|
|
character::CharacterSheet billy;
|
2022-02-09 23:43:49 +01:00
|
|
|
gui::GuiData gui_data(billy);
|
2022-01-17 22:00:26 +01:00
|
|
|
gui::menu::MenuData menu_data(billy);
|
|
|
|
Controller controller(billy, menu_data);
|
2022-02-09 23:43:49 +01:00
|
|
|
gui::Gui gui(window, gui_data, menu_data);
|
2022-01-09 00:43:33 +01:00
|
|
|
|
|
|
|
while (!window.should_close()) {
|
|
|
|
glfwPollEvents();
|
2022-01-25 19:53:58 +01:00
|
|
|
controller.control_sheet();
|
2022-01-09 00:43:33 +01:00
|
|
|
|
2022-01-20 22:30:14 +01:00
|
|
|
gui.render_gui(controller);
|
2022-01-09 00:43:33 +01:00
|
|
|
gui.render_gpu();
|
|
|
|
|
|
|
|
window.swap_buffers();
|
|
|
|
}
|
|
|
|
} catch (const std::exception &e) {
|
|
|
|
SPDLOG_CRITICAL(e.what());
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
}
|
2022-01-08 20:02:04 +01:00
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|