BillySheet/src/main.cpp

37 lines
993 B
C++
Raw Normal View History

#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"
#include "gui/menu/menu_data.hpp"
2022-01-11 22:33:29 +01:00
#include "gui/gui_data.hpp"
#include "gui/gui.hpp"
#include "controller.hpp"
#include "character_sheet.hpp"
2022-01-08 20:02:04 +01:00
int main() {
2024-01-28 20:31:50 +01:00
std::ios::sync_with_stdio(false);
spdlog::set_default_logger(spdlog::stdout_color_st("BillySheet"));
2022-01-09 00:43:33 +01:00
2024-01-28 20:31:50 +01:00
try {
gui::Window window;
character::CharacterSheet billy;
gui::GuiData gui_data(billy);
gui::menu::MenuData menu_data(billy);
Controller controller(billy, menu_data);
gui::Gui gui(window, gui_data, menu_data);
2022-01-09 00:43:33 +01:00
2024-01-28 20:31:50 +01:00
while (!window.should_close()) {
glfwPollEvents();
controller.control_sheet();
2022-01-09 00:43:33 +01:00
2024-01-28 20:31:50 +01:00
gui.render_gui(controller);
gui.render_gpu();
2022-01-09 00:43:33 +01:00
2024-01-28 20:31:50 +01:00
window.swap_buffers();
}
} catch (const std::exception &e) {
SPDLOG_CRITICAL(e.what());
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
2022-01-08 20:02:04 +01:00
}