From a1d9017be2d34d5a45c8ed60bb0f1c1f43b4ac92 Mon Sep 17 00:00:00 2001 From: illegitimate-egg Date: Thu, 10 Oct 2024 15:59:55 +0100 Subject: [PATCH] Moving to different machine for development --- CMakeLists.txt | 4 ++-- TODO.md | 3 +++ engine.cpp | 38 +++++++++++++++----------------------- 3 files changed, 20 insertions(+), 25 deletions(-) create mode 100644 TODO.md diff --git a/CMakeLists.txt b/CMakeLists.txt index e8c63b1..02fa3e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,13 +55,13 @@ add_library( include/imgui/backends/imgui_impl_opengl3.cpp) target_link_libraries(imgui glfw) -include_directories(include) # Kill me please +# include_directories(include) # Kill me please. this is horrendously bad but ImGuIZMO.quat hardcodes imgui to be in a folder called ImGui include_directories(include/imGuIZMO.quat) add_library( imGuIZMO STATIC include/imGuIZMO.quat/imGuIZMO.quat/imGuIZMOquat.cpp ) -target_link_libraries(imGuIZMO imgui) +target_link_libraries(imGuIZMO imgui -DIMGUIZMO_IMGUI_FOLDER=${CMAKE_SOURCE_DIR}/include/imgui) add_executable(fred engine.cpp shader.c) if(UNIX) diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..3b8660c --- /dev/null +++ b/TODO.md @@ -0,0 +1,3 @@ +[ ] Make ImGuIZMO.quat work +[ ] Make SOIL2 stop giving that smelly error message +[ ] Overhaul asset debug screen diff --git a/engine.cpp b/engine.cpp index ca36ca7..916511d 100644 --- a/engine.cpp +++ b/engine.cpp @@ -1,4 +1,3 @@ -#include "imGuIZMO.quat/vgMath.h" #include #include #include @@ -14,9 +13,10 @@ #include #define IMGUI_DEFINE_MATH_OPERATORS // ImGui -#include -#include +#include +#include #include +#define VGIZMO_USES_GLM #include #include @@ -302,17 +302,17 @@ static int initWindow() { return 0; } -void imguiMat4Table(glm::mat4 matrix, const char *name) { - if (ImGui::BeginTable(name, 4)) { - for (int i = 0; i < 4; i++) { - for (int j = 0; j < 4; j++) { - ImGui::TableNextColumn(); - ImGui::Text("%f", matrix[i][j]); - } - } - ImGui::EndTable(); - } -} +//void imguiMat4Table(glm::mat4 matrix, const char *name) { +// if (ImGui::BeginTable(name, 4)) { +// for (int i = 0; i < 4; i++) { +// for (int j = 0; j < 4; j++) { +// ImGui::TableNextColumn(); +// ImGui::Text("%f", matrix[i][j]); +// } +// } +// ImGui::EndTable(); +// } +//} void render(Scene scene) { // Clear this mf @@ -338,15 +338,7 @@ void render(Scene scene) { char assetName[] = "Asset: 00"; sprintf(assetName, "Asset: %d", i); ImGui::Begin(assetName); - - ImGui::SeparatorText("Position Matrix:"); - imguiMat4Table(translationMatrix, "posmat"); - ImGui::SeparatorText("Rotation Matrix:"); - imguiMat4Table(rotationMatrix, "rotmat"); - ImGui::SeparatorText("Scaling Matrix:"); - imguiMat4Table(scalingMatrix, "scalmat"); - ImGui::SeparatorText("Model Matrix:"); - imguiMat4Table(modelMatrix, "modmat"); + ImGui::gizmo3D(assetName, currentAsset->rotation); ImGui::End(); glUniformMatrix4fv(currentAsset->matrixID, 1, GL_FALSE, &mvp[0][0]);