Better organization.

This commit is contained in:
Pcornat 2022-01-11 22:33:29 +01:00
parent c7b6b87005
commit 45c92db758
Signed by: Pcornat
GPG Key ID: 2F3932FF46D9ECA0
8 changed files with 26 additions and 20 deletions

View File

@ -4,9 +4,9 @@ project(BillySheet LANGUAGES CXX C)
find_package(OpenGL REQUIRED)
set(PRECOMPILE_HEADERS
include/gui.hpp
include/gui_data.hpp
include/window.hpp
include/gui/gui.hpp
include/gui/gui_data.hpp
include/gui/window.hpp
)
set(SOURCE_HEADERS
@ -19,9 +19,9 @@ set(SOURCE_HEADERS
include/imgui/imstb_rectpack.h
include/imgui/imstb_textedit.h
include/imgui/imstb_truetype.h
include/gui.hpp
include/gui_data.hpp
include/window.hpp
include/gui/gui.hpp
include/gui/gui_data.hpp
include/gui/window.hpp
include/character_sheet.hpp
include/characteristic/habilete.hpp
include/characteristic/adresse.hpp
@ -37,9 +37,9 @@ set(SOURCE_FILES
src/imgui/imgui_tables.cpp
src/imgui/imgui_widgets.cpp
src/main.cpp
src/gui.cpp
src/gui_data.cpp
src/window.cpp
src/gui/gui.cpp
src/gui/gui_data.cpp
src/gui/window.cpp
src/character_sheet.cpp
src/characteristic/adresse.cpp
src/characteristic/endurance.cpp

View File

@ -2,8 +2,11 @@
#define BILLYSHEET_GUI_DATA_HPP
#include "character_sheet.hpp"
#include <filesystem>
#include <spdlog/spdlog.h>
namespace fs = std::filesystem;
namespace gui {
class Window;
@ -13,6 +16,9 @@ namespace gui {
character::CharacterSheet billy;
fs::path save_path{ "./" };
std::string filename{ "character_sheet.json" };
public:
GuiData() = delete;

View File

@ -3,7 +3,7 @@
#include <memory>
#include "imgui_impl_opengl3_loader.h"
#include <GLFW/glfw3.h>
#include "GLFW/glfw3.h"
namespace gui {
class Window final {

View File

@ -1,10 +1,10 @@
#include "gui.hpp"
#include "gui_data.hpp"
#include "gui/gui.hpp"
#include "gui/gui_data.hpp"
#include "imgui.h"
#include "imgui_impl_glfw.h"
#include "imgui_impl_opengl3.h"
#include "imgui_impl_opengl3_loader.h"
#include "window.hpp"
#include "gui/window.hpp"
gui::Gui::Gui(gui::GuiData &data) : data(data), font("font/DejaVuSans.ttf") {
SPDLOG_DEBUG("Creating GUI");

View File

@ -1,4 +1,4 @@
#include "gui_data.hpp"
#include "window.hpp"
#include "gui/gui_data.hpp"
#include "gui/window.hpp"
gui::Window &gui::GuiData::get_window() const { return window; }

View File

@ -1,6 +1,6 @@
#include "window.hpp"
#include "gui/window.hpp"
#include <stdexcept>
#include <spdlog/spdlog.h>
#include "spdlog/spdlog.h"
static void glfwErrorCallback(int error, const char *message) {
SPDLOG_CRITICAL("Error code{}: {}", error, message);

View File

@ -1,8 +1,8 @@
#include <spdlog/spdlog.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include "window.hpp"
#include "gui_data.hpp"
#include "gui.hpp"
#include "gui/window.hpp"
#include "gui/gui_data.hpp"
#include "gui/gui.hpp"
int main() {
std::ios::sync_with_stdio(false);