Merge branch 'main' into feature/3-mesh-tessellation
This commit is contained in:
		
						commit
						9fa18ac69e
					
				
							
								
								
									
										16
									
								
								imgui.ini
								
								
								
								
							
							
						
						
									
										16
									
								
								imgui.ini
								
								
								
								
							| 
						 | 
					@ -19,7 +19,7 @@ Collapsed=0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Window][TerraVisor]
 | 
					[Window][TerraVisor]
 | 
				
			||||||
Pos=0,0
 | 
					Pos=0,0
 | 
				
			||||||
Size=1280,946
 | 
					Size=2880,1676
 | 
				
			||||||
Collapsed=0
 | 
					Collapsed=0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Window][Scene Window]
 | 
					[Window][Scene Window]
 | 
				
			||||||
| 
						 | 
					@ -29,21 +29,21 @@ Collapsed=0
 | 
				
			||||||
DockId=0x00000003,0
 | 
					DockId=0x00000003,0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Window][Viewport]
 | 
					[Window][Viewport]
 | 
				
			||||||
Pos=0,19
 | 
					Pos=0,34
 | 
				
			||||||
Size=862,927
 | 
					Size=2134,1641
 | 
				
			||||||
Collapsed=0
 | 
					Collapsed=0
 | 
				
			||||||
DockId=0x00000003,0
 | 
					DockId=0x00000003,0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Window][Scene Settings]
 | 
					[Window][Scene Settings]
 | 
				
			||||||
Pos=864,19
 | 
					Pos=2137,34
 | 
				
			||||||
Size=416,927
 | 
					Size=743,1641
 | 
				
			||||||
Collapsed=0
 | 
					Collapsed=0
 | 
				
			||||||
DockId=0x00000004,0
 | 
					DockId=0x00000004,0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[Docking][Data]
 | 
					[Docking][Data]
 | 
				
			||||||
DockSpace     ID=0x6F42A598 Window=0xE80F322C Pos=0,19 Size=1280,927 Split=X Selected=0x9F2D9299
 | 
					DockSpace     ID=0x6F42A598 Window=0xE80F322C Pos=0,34 Size=2880,1641 Split=X Selected=0x9F2D9299
 | 
				
			||||||
  DockNode    ID=0x00000001 Parent=0x6F42A598 SizeRef=0,0 Split=X Selected=0x13926F0B
 | 
					  DockNode    ID=0x00000001 Parent=0x6F42A598 SizeRef=0,0 Split=X Selected=0x13926F0B
 | 
				
			||||||
    DockNode  ID=0x00000003 Parent=0x00000001 SizeRef=862,701 CentralNode=1 Selected=0x13926F0B
 | 
					    DockNode  ID=0x00000003 Parent=0x00000001 SizeRef=2134,701 CentralNode=1 Selected=0x13926F0B
 | 
				
			||||||
    DockNode  ID=0x00000004 Parent=0x00000001 SizeRef=416,701 Selected=0x413E6147
 | 
					    DockNode  ID=0x00000004 Parent=0x00000001 SizeRef=743,701 Selected=0x413E6147
 | 
				
			||||||
  DockNode    ID=0x00000002 Parent=0x6F42A598 SizeRef=419,701 Selected=0xF69494A7
 | 
					  DockNode    ID=0x00000002 Parent=0x6F42A598 SizeRef=419,701 Selected=0xF69494A7
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| 
						 | 
					@ -1,6 +1,7 @@
 | 
				
			||||||
#ifndef INTERFACE_H_
 | 
					#ifndef INTERFACE_H_
 | 
				
			||||||
#define INTERFACE_H_
 | 
					#define INTERFACE_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <GLFW/glfw3.h>
 | 
				
			||||||
#include <imgui.h>
 | 
					#include <imgui.h>
 | 
				
			||||||
#include <string>
 | 
					#include <string>
 | 
				
			||||||
#include <vector>
 | 
					#include <vector>
 | 
				
			||||||
| 
						 | 
					@ -19,6 +20,7 @@ struct Window {
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Interface {
 | 
					namespace Interface {
 | 
				
			||||||
 | 
					    void ApplyUIScaling(GLFWwindow* window);
 | 
				
			||||||
    void AddWindow(std::vector<Window>& windows, const std::string& name, std::function<void()> renderFunc);
 | 
					    void AddWindow(std::vector<Window>& windows, const std::string& name, std::function<void()> renderFunc);
 | 
				
			||||||
    Window* GetWindowByName(std::vector<Window>& windows, const std::string& name);
 | 
					    Window* GetWindowByName(std::vector<Window>& windows, const std::string& name);
 | 
				
			||||||
    void RenderWindows(std::vector<Window>& windows);
 | 
					    void RenderWindows(std::vector<Window>& windows);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,9 +4,32 @@
 | 
				
			||||||
#include <imgui_impl_opengl3.h>
 | 
					#include <imgui_impl_opengl3.h>
 | 
				
			||||||
#include <algorithm>
 | 
					#include <algorithm>
 | 
				
			||||||
#include <iostream>
 | 
					#include <iostream>
 | 
				
			||||||
 | 
					#include <filesystem>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Interface {
 | 
					namespace Interface {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void ApplyUIScaling(GLFWwindow* window) {
 | 
				
			||||||
 | 
					    float xScale, yScale;
 | 
				
			||||||
 | 
					    glfwGetWindowContentScale(window, &xScale, &yScale);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    float scale = (xScale + yScale) * 0.5f;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ImGui::GetIO().FontGlobalScale = scale;
 | 
				
			||||||
 | 
					    ImGuiStyle& style = ImGui::GetStyle();
 | 
				
			||||||
 | 
					    style.ScaleAllSizes(scale);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ImGuiIO& io = ImGui::GetIO();
 | 
				
			||||||
 | 
					    io.Fonts->Clear();
 | 
				
			||||||
 | 
					    std::cout << "Current Path: " << std::filesystem::current_path() << std::endl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef _WIN32
 | 
				
			||||||
 | 
					    io.Fonts->AddFontFromFileTTF("imgui/misc/fonts/JetBrainsMono/JetBrainsMono-Medium.ttf", 8.0f * scale);
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					    io.Fonts->AddFontFromFileTTF("../imgui/misc/fonts/JetBrainsMono/JetBrainsMono-Medium.ttf", 8.0f * scale);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					    io.Fonts->Build();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void AddWindow(std::vector<Window>& windows, const std::string& name, std::function<void()> renderFunc) {
 | 
					void AddWindow(std::vector<Window>& windows, const std::string& name, std::function<void()> renderFunc) {
 | 
				
			||||||
    windows.emplace_back(name, renderFunc);
 | 
					    windows.emplace_back(name, renderFunc);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -42,6 +42,7 @@
 | 
				
			||||||
#include "config.h"
 | 
					#include "config.h"
 | 
				
			||||||
#include "callbacks.h"
 | 
					#include "callbacks.h"
 | 
				
			||||||
#include "scene.h"
 | 
					#include "scene.h"
 | 
				
			||||||
 | 
					#include "interface.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace {
 | 
					namespace {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -156,6 +157,7 @@ int main() {
 | 
				
			||||||
    scene.Init();
 | 
					    scene.Init();
 | 
				
			||||||
    InitializeImGui(window);
 | 
					    InitializeImGui(window);
 | 
				
			||||||
    FreeImage_Initialise();
 | 
					    FreeImage_Initialise();
 | 
				
			||||||
 | 
					    Interface::ApplyUIScaling(window);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Check if we're in test mode
 | 
					    // Check if we're in test mode
 | 
				
			||||||
    const char* testEnv = std::getenv("TEST_MODE");
 | 
					    const char* testEnv = std::getenv("TEST_MODE");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue