From b197958ccf45793b6b42fa19cb8671212f76600e Mon Sep 17 00:00:00 2001 From: illegitimate-egg Date: Sun, 13 Oct 2024 18:51:01 +0100 Subject: [PATCH] Fix this sorry repository --- .gitmodules | 39 ++++++++++++++++++--------------------- TODO.md | 10 ++++++++-- models/suzanne.mtl | 12 ------------ models/teapot.mtl | 2 -- src/engine.cpp | 15 +++++++++++++-- textures/fred.cprj | 41 ----------------------------------------- 6 files changed, 39 insertions(+), 80 deletions(-) delete mode 100644 models/suzanne.mtl delete mode 100644 models/teapot.mtl delete mode 100644 textures/fred.cprj diff --git a/.gitmodules b/.gitmodules index e4a8917..d235396 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,30 +1,27 @@ -[submodule "SOIL2"] - path = SOIL2 +[submodule "extern/SOIL2"] + path = extern/SOIL2 url = https://github.com/SpartanJ/SOIL2 -[submodule "include/SOIL2"] - path = include/SOIL2 - url = https://github.com/SpartanJ/SOIL2 -[submodule "include/assimp"] - path = include/assimp +[submodule "extern/assimp"] + path = extern/assimp url = https://github.com/assimp/assimp -[submodule "include/glew"] - path = include/glew +[submodule "extern/glew"] + path = extern/glew url = https://github.com/nigels-com/glew -[submodule "include/glfw"] - path = include/glfw +[submodule "extern/glfw"] + path = extern/glfw url = https://github.com/glfw/glfw -[submodule "include/glm"] - path = include/glm +[submodule "extern/glm"] + path = extern/glm url = https://github.com/g-truc/glm -[submodule "include/imgui"] - path = include/imgui +[submodule "extern/imgui"] + path = extern/imgui url = https://github.com/ocornut/imgui -[submodule "include/CLog"] - path = include/CLog +[submodule "extern/CLog"] + path = extern/CLog url = https://github.com/williamistGitHub/CLog.git -[submodule "include/glad"] - path = include/glad +[submodule "extern/glad"] + path = extern/glad url = https://github.com/Dav1dde/glad.git -[submodule "include/imGuIZMO.quat"] - path = include/imGuIZMO.quat +[submodule "extern/imGuIZMO.quat"] + path = extern/imGuIZMO.quat url = https://github.com/BrutPitt/imGuIZMO.quat diff --git a/TODO.md b/TODO.md index 2d3c6be..a6c2c45 100644 --- a/TODO.md +++ b/TODO.md @@ -1,5 +1,5 @@ - [x] Destruct all at the end -- [x] ~~Make ImGuIZMO.quat work~~ No longer required +- [ ] Make ImGuIZMO.quat work - [ ] Finish modularization - [ ] Make SOIL2 stop giving that smelly error message Wtf is this warning? @@ -15,11 +15,17 @@ This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at include/SOIL2/CMakeLists.txt:67 (install): Target soil2 has PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION. This warning is for project developers. Use -Wno-dev to suppress it. + - [x] Overhaul asset debug screen - [x] Simple Lighting -- [ ] Lightmapped Lighting +- [ ] Lightmapped/Shadowmapped Lighting - [ ] Get ziggy with it - [x] Implement Cameras +- [ ] Text +- [ ] RT/texture rendering +- [ ] Additional constructors for arguements that are potentially optional +- [ ] Billboards / Instancing +- [ ] Multiple lights - [ ] Physics - [ ] Sound diff --git a/models/suzanne.mtl b/models/suzanne.mtl deleted file mode 100644 index ea94d04..0000000 --- a/models/suzanne.mtl +++ /dev/null @@ -1,12 +0,0 @@ -# Blender 3.6.16 MTL File: 'None' -# www.blender.org - -newmtl Material.001 -Ns 250.000000 -Ka 1.000000 1.000000 1.000000 -Ke 0.000000 0.000000 0.000000 -Ni 1.450000 -d 1.000000 -illum 1 -map_Kd /home/illegitimate-egg/fred/textures/suzanne_albedo.png -map_Ks /home/illegitimate-egg/fred/textures/suzanne_specular.png diff --git a/models/teapot.mtl b/models/teapot.mtl deleted file mode 100644 index 497fc7e..0000000 --- a/models/teapot.mtl +++ /dev/null @@ -1,2 +0,0 @@ -# Blender 4.2.2 LTS MTL File: 'None' -# www.blender.org diff --git a/src/engine.cpp b/src/engine.cpp index 337b5f3..362fd86 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -373,9 +373,9 @@ void destroy() { void render(Scene scene) { // Clear this mf glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + static double lastTime = glfwGetTime(); double currentTime = glfwGetTime(); - deltaTime = float(currentTime - lastTime); lastTime = currentTime; @@ -476,10 +476,21 @@ void render(Scene scene) { // Userspace ================================================================ // +fred::Scene scene; + void renderCallback() { ImGui::Begin("User Render Callback"); ImGui::Text("Frametime (ms): %f", fred::getUnscaledDeltaTime() * 1000); ImGui::Text("FPS: %f", 1/fred::getUnscaledDeltaTime()); + ImGui::SeparatorText("Camera"); + fred::Camera *currentCamera = scene.cameras[scene.activeCamera]; + glm::vec3 rotationEuler = glm::degrees(eulerAngles(currentCamera->rotation)); + ImGui::DragFloat3("Translate", (float*)¤tCamera->position, 0.01f); + ImGui::DragFloat3("Rotate", (float*)&rotationEuler); + float fovDeg = glm::degrees(currentCamera->fov); + ImGui::DragFloat("FOV", (float*)&fovDeg); + currentCamera->fov = glm::radians(fovDeg); + currentCamera->rotation = glm::quat(glm::radians(rotationEuler)); ImGui::End(); } @@ -498,7 +509,7 @@ int main() { fred::Camera mainCamera(glm::vec3(4, 3, 3)); mainCamera.lookAt(glm::vec3(0, 0, 0)); - fred::Scene scene = fred::Scene(); + scene = fred::Scene(); scene.addCamera(mainCamera); diff --git a/textures/fred.cprj b/textures/fred.cprj deleted file mode 100644 index 813ded2..0000000 --- a/textures/fred.cprj +++ /dev/null @@ -1,41 +0,0 @@ - - - - - //wsl.localhost/Fedora/home/fedora/fred/textures/texture.bmp - //wsl.localhost/Fedora/home/fedora/fred/textures/results/texture_BMP_DXT3_2.DDS - DXT3 - 0.2 - 0.3086 - 0.6094 - 0.082 - 0 - 0 - 8.00 - - - //wsl.localhost/Fedora/home/fedora/fred/textures/texture.bmp - //wsl.localhost/Fedora/home/fedora/fred/textures/results/texture_BMP_DXT5_3.DDS - DXT5 - 0.05 - 0.3086 - 0.6094 - 0.082 - 0 - 0 - 8.00 - - - //wsl.localhost/Fedora/home/fedora/fred/textures/texture.bmp - //wsl.localhost/Fedora/home/fedora/fred/textures/results/texture_BMP_DXT1_1.DDS - DXT1 - 0.05 - 0.3086 - 0.6094 - 0.082 - 0 - 0 - 8.00 - - - \ No newline at end of file