feat: add imgui texture inspector (Thanks claude)
This commit is contained in:
+51
-6
@@ -195,13 +195,31 @@ if (!isRunning) break;
|
||||
if (m_params.showDebugUi)
|
||||
{
|
||||
ZoneScopedN("Debug ImGui");
|
||||
SceneManager::GetInstance().RenderImgui();
|
||||
drawWindowsMenu();
|
||||
|
||||
ImGui::Begin("Debug");
|
||||
ImGui::Text("FPS: %.2f", avgFPS);
|
||||
ImGui::End();
|
||||
if (m_DebugWindows.inspector)
|
||||
{
|
||||
SceneManager::GetInstance().RenderImgui(&m_DebugWindows.inspector);
|
||||
}
|
||||
|
||||
drawPhysicsPanel(dt, fixedDt, accumulator);
|
||||
if (m_DebugWindows.stats)
|
||||
{
|
||||
if (ImGui::Begin("Debug", &m_DebugWindows.stats))
|
||||
{
|
||||
ImGui::Text("FPS: %.2f", avgFPS);
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
if (m_DebugWindows.physics)
|
||||
{
|
||||
drawPhysicsPanel(dt, fixedDt, accumulator);
|
||||
}
|
||||
|
||||
if (m_DebugWindows.imageCache)
|
||||
{
|
||||
m_ResourcesInspector.drawImageCacheWindow(&m_DebugWindows.imageCache, resources, imguiPass);
|
||||
}
|
||||
|
||||
TracyPlot("FPS", avgFPS);
|
||||
TracyPlot("Frame Time ms", dt * 1000.0f);
|
||||
@@ -359,9 +377,36 @@ void App::cleanup()
|
||||
}
|
||||
}
|
||||
|
||||
void App::drawWindowsMenu()
|
||||
{
|
||||
// ImGui appends to the main menu bar, so this ends up next to whatever menus the game added
|
||||
if (!ImGui::BeginMainMenuBar())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (ImGui::BeginMenu("Windows"))
|
||||
{
|
||||
ImGui::MenuItem("Debug", nullptr, &m_DebugWindows.stats);
|
||||
ImGui::MenuItem("Physics", nullptr, &m_DebugWindows.physics);
|
||||
ImGui::MenuItem("Inspector", nullptr, &m_DebugWindows.inspector);
|
||||
ImGui::MenuItem("Image Cache", nullptr, &m_DebugWindows.imageCache);
|
||||
|
||||
customWindowsMenu();
|
||||
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
ImGui::EndMainMenuBar();
|
||||
}
|
||||
|
||||
void App::drawPhysicsPanel(float dt, float fixedDt, float accumulator)
|
||||
{
|
||||
ImGui::Begin("Physics");
|
||||
if (!ImGui::Begin("Physics", &m_DebugWindows.physics))
|
||||
{
|
||||
ImGui::End();
|
||||
return;
|
||||
}
|
||||
|
||||
ImGui::Text("Frame dt: %.3f ms", dt * 1000.0f);
|
||||
ImGui::Text("Fixed dt: %.3f ms", fixedDt * 1000.0f);
|
||||
|
||||
Reference in New Issue
Block a user