BillySheet/src/main.cpp

37 lines
867 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() {
std::ios::sync_with_stdio(false);
2022-01-09 00:43:33 +01:00
spdlog::set_default_logger(spdlog::stdout_color_st("console"));
try {
2022-01-10 21:16:05 +01:00
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);
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;
}