From e8652e544a9bc331a76a6af9bc33d6f33eb8ea1f Mon Sep 17 00:00:00 2001 From: Triang3l Date: Sun, 17 Jul 2022 17:29:41 +0300 Subject: [PATCH] [GPU] Translucent trace viewer controls --- src/xenia/gpu/trace_viewer.cc | 4 ++++ src/xenia/gpu/trace_viewer.h | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/xenia/gpu/trace_viewer.cc b/src/xenia/gpu/trace_viewer.cc index 5d5978fd1..0d43b0a5e 100644 --- a/src/xenia/gpu/trace_viewer.cc +++ b/src/xenia/gpu/trace_viewer.cc @@ -223,6 +223,7 @@ void TraceViewer::DrawUI() { void TraceViewer::DrawControllerUI() { ImGui::SetNextWindowPos(ImVec2(5, 5), ImGuiCond_FirstUseEver); ImGui::SetNextWindowSize(ImVec2(340, 60)); + ImGui::SetNextWindowBgAlpha(kWindowBgAlpha); if (!ImGui::Begin("Controller", nullptr)) { ImGui::End(); return; @@ -274,6 +275,7 @@ void TraceViewer::DrawPacketDisassemblerUI() { ImVec2(float(window_->GetActualLogicalWidth()) - 500 - 5, 5), ImGuiCond_FirstUseEver); ImGui::SetNextWindowSize(ImVec2(500, 300)); + ImGui::SetNextWindowBgAlpha(kWindowBgAlpha); if (!ImGui::Begin("Packet Disassembler", nullptr)) { ImGui::End(); return; @@ -493,6 +495,7 @@ int TraceViewer::RecursiveDrawCommandBufferUI( void TraceViewer::DrawCommandListUI() { ImGui::SetNextWindowPos(ImVec2(5, 70), ImGuiCond_FirstUseEver); ImGui::SetNextWindowSize(ImVec2(200, 640)); + ImGui::SetNextWindowBgAlpha(kWindowBgAlpha); if (!ImGui::Begin("Command List", nullptr)) { ImGui::End(); return; @@ -1106,6 +1109,7 @@ void TraceViewer::DrawStateUI() { ImVec2(float(window_->GetActualLogicalWidth()) - 500 - 5, 30), ImGuiCond_FirstUseEver); ImGui::SetNextWindowSize(ImVec2(500, 680)); + ImGui::SetNextWindowBgAlpha(kWindowBgAlpha); if (!ImGui::Begin("State", nullptr)) { ImGui::End(); return; diff --git a/src/xenia/gpu/trace_viewer.h b/src/xenia/gpu/trace_viewer.h index b41b18aca..58ab16e4e 100644 --- a/src/xenia/gpu/trace_viewer.h +++ b/src/xenia/gpu/trace_viewer.h @@ -95,6 +95,11 @@ class TraceViewer : public xe::ui::WindowedApp { kHostDisasm, }; + // Same as for Dear ImGui tooltips. Windows are translucent as the controls + // may take a pretty large fraction of the screen, especially on small + // screens, so the image from the guest can be seen through them. + static constexpr float kWindowBgAlpha = 0.6f; + bool Load(const std::string_view trace_file_path); void DrawUI();