diff options
Diffstat (limited to 'src/game.cpp')
| -rw-r--r-- | src/game.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp index 5885e64..98e9336 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -216,6 +216,16 @@ void Game_Tick(double delta) { ECS_Tick_Late(delta); } +void RecordImGui_GLM(glm::mat4 &mat) { + float min = -1; + float max = 1; + for (long i = 0; i < 4; ++i) { + ImGui::PushID(i); + ImGui::SliderFloat4("##mat4", &mat[i][0], min, max, "%.3f", ImGuiSliderFlags_NoRoundToFormat); + ImGui::PopID(); + } +} + void RecordImGuiEditorWrapper() { ImGui::DockSpaceOverViewport(nullptr, ImGuiDockNodeFlags_PassthruCentralNode); ImGui::BeginMainMenuBar(); @@ -311,6 +321,20 @@ void RecordImGuiEntityList() { ImGui::End(); } +void RecordImGuiUBO() { + if (!ImGui::Begin("UBO", &pkeSettings.editorSettings.isShowingUBO)) { + ImGui::End(); + return; + } + ImGui::Text("Model"); + RecordImGui_GLM(UBO.model); + ImGui::Text("View"); + RecordImGui_GLM(UBO.view); + ImGui::Text("Proj"); + RecordImGui_GLM(UBO.proj); + ImGui::End(); +} + void RecordImGuiModalCreateEntityType() { if (ImGui::BeginPopupModal("CreateEntityType", nullptr, ImGuiWindowFlags_AlwaysAutoResize)) { static bool needsReset = true; @@ -478,6 +502,7 @@ void RecordImGuiEditor() { RecordImGuiConsole(); RecordImGuiEntityList(); RecordImGuiSceneEditor(); + RecordImGuiUBO(); } } |
