Compare commits
	
		
			2 commits
		
	
	
		
			
				c7b6b87005
			
			...
			
				58a16c68e4
			
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
							
							
								
							
							
	
	
		
			
		
	
	58a16c68e4 | 
						
						
							|||
| 
							
							
								
							
							
	
	
		
			
		
	
	45c92db758 | 
						
						
							
					 10 changed files with 64 additions and 20 deletions
				
			
		| 
						 | 
				
			
			@ -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,14 +19,15 @@ 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
 | 
			
		||||
	include/characteristic/endurance.hpp
 | 
			
		||||
	include/characteristic/chance.hpp
 | 
			
		||||
	include/gui/menu.hpp
 | 
			
		||||
	)
 | 
			
		||||
 | 
			
		||||
set(SOURCE_FILES
 | 
			
		||||
| 
						 | 
				
			
			@ -37,13 +38,14 @@ 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
 | 
			
		||||
	src/characteristic/chance.cpp
 | 
			
		||||
	src/gui/menu.cpp
 | 
			
		||||
	)
 | 
			
		||||
 | 
			
		||||
set(SOURCES
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										23
									
								
								include/gui/menu.hpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								include/gui/menu.hpp
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,23 @@
 | 
			
		|||
#ifndef BILLYSHEET_MENU_HPP
 | 
			
		||||
#define BILLYSHEET_MENU_HPP
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
namespace gui {
 | 
			
		||||
	class GuiData;
 | 
			
		||||
 | 
			
		||||
	class Menu final {
 | 
			
		||||
	private:
 | 
			
		||||
		GuiData &data;
 | 
			
		||||
	public:
 | 
			
		||||
		Menu() noexcept = delete;
 | 
			
		||||
 | 
			
		||||
		explicit Menu(GuiData &data) noexcept: data(data) {}
 | 
			
		||||
 | 
			
		||||
		~Menu() noexcept = default;
 | 
			
		||||
 | 
			
		||||
		void gui() const noexcept;
 | 
			
		||||
	};
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif //BILLYSHEET_MENU_HPP
 | 
			
		||||
| 
						 | 
				
			
			@ -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 {
 | 
			
		||||
| 
						 | 
				
			
			@ -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");
 | 
			
		||||
| 
						 | 
				
			
			@ -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; }
 | 
			
		||||
							
								
								
									
										13
									
								
								src/gui/menu.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								src/gui/menu.cpp
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,13 @@
 | 
			
		|||
#include "gui/menu.hpp"
 | 
			
		||||
#include "imgui.h"
 | 
			
		||||
 | 
			
		||||
void gui::Menu::gui() const noexcept {
 | 
			
		||||
	if (ImGui::BeginMainMenuBar()) {
 | 
			
		||||
		if (ImGui::BeginMenu("File")) {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
			ImGui::EndMenu();
 | 
			
		||||
		}
 | 
			
		||||
		ImGui::EndMainMenuBar();
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue