Submodule for JSON added.
Menu data and menu in their own folder.
This commit is contained in:
		
					parent
					
						
							
								27c571a6b9
							
						
					
				
			
			
				commit
				
					
						9142896237
					
				
			
		
					 12 changed files with 106 additions and 60 deletions
				
			
		| 
						 | 
				
			
			@ -6,7 +6,7 @@
 | 
			
		|||
#include "imgui_impl_opengl3_loader.h"
 | 
			
		||||
#include "gui/window.hpp"
 | 
			
		||||
 | 
			
		||||
gui::Gui::Gui(gui::GuiData &data) : data(data), menu(data), font("font/DejaVuSans.ttf") {
 | 
			
		||||
gui::Gui::Gui(GuiData &data, menu::MenuData &menuData) : data(data), menu(menuData), font("font/DejaVuSans.ttf") {
 | 
			
		||||
	SPDLOG_DEBUG("Creating GUI");
 | 
			
		||||
	(void) ImGui::CreateContext();
 | 
			
		||||
	ImGui::StyleColorsDark();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,19 +0,0 @@
 | 
			
		|||
#include "gui/menu.hpp"
 | 
			
		||||
#include "imgui.h"
 | 
			
		||||
 | 
			
		||||
void gui::Menu::gui() const noexcept {
 | 
			
		||||
	if (ImGui::BeginMenuBar()) {
 | 
			
		||||
		if (ImGui::BeginMenu("File")) {
 | 
			
		||||
			if (ImGui::MenuItem("Save")) {
 | 
			
		||||
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			if (ImGui::MenuItem("Save as...")) {
 | 
			
		||||
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			ImGui::EndMenu();
 | 
			
		||||
		}
 | 
			
		||||
		ImGui::EndMenuBar();
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										24
									
								
								src/gui/menu/menu.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								src/gui/menu/menu.cpp
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,24 @@
 | 
			
		|||
#include "gui/menu/menu.hpp"
 | 
			
		||||
#include "imgui.h"
 | 
			
		||||
#include "gui/menu/menu_data.hpp"
 | 
			
		||||
 | 
			
		||||
void gui::menu::Menu::gui() const noexcept {
 | 
			
		||||
	if (ImGui::BeginMenuBar()) {
 | 
			
		||||
		if (ImGui::BeginMenu("File")) {
 | 
			
		||||
			if (ImGui::MenuItem("Save")) {
 | 
			
		||||
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			if (ImGui::MenuItem("Save as...")) {
 | 
			
		||||
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			ImGui::EndMenu();
 | 
			
		||||
		}
 | 
			
		||||
		if (ImGui::BeginMenu("Editor")) {
 | 
			
		||||
			ImGui::MenuItem("Edit mode", nullptr, &data.edit_mode);
 | 
			
		||||
			ImGui::EndMenu();
 | 
			
		||||
		}
 | 
			
		||||
		ImGui::EndMenuBar();
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,6 +1,7 @@
 | 
			
		|||
#include <spdlog/spdlog.h>
 | 
			
		||||
#include <spdlog/sinks/stdout_color_sinks.h>
 | 
			
		||||
#include "gui/window.hpp"
 | 
			
		||||
#include "gui/menu/menu_data.hpp"
 | 
			
		||||
#include "gui/gui_data.hpp"
 | 
			
		||||
#include "gui/gui.hpp"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -11,7 +12,8 @@ int main() {
 | 
			
		|||
	try {
 | 
			
		||||
		gui::Window window;
 | 
			
		||||
		gui::GuiData gui_data(window);
 | 
			
		||||
		gui::Gui gui(gui_data);
 | 
			
		||||
		gui::menu::MenuData menu_data;
 | 
			
		||||
		gui::Gui gui(gui_data, menu_data);
 | 
			
		||||
 | 
			
		||||
		while (!window.should_close()) {
 | 
			
		||||
			glfwPollEvents();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue