MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / guiTopRight

Method guiTopRight

Sources/nCine/Graphics/ImGuiDebugOverlay.cpp:1408–1502  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1406#endif
1407
1408 void ImGuiDebugOverlay::guiTopRight()
1409 {
1410 if (!showTopRightOverlay_) {
1411 return;
1412 }
1413
1414 const ImVec2 windowPos = ImVec2(ImGui::GetIO().DisplaySize.x - Margin, Margin);
1415 const ImVec2 windowPosPivot = ImVec2(1.0f, 0.0f);
1416 ImGui::SetNextWindowPos(windowPos, ImGuiCond_FirstUseEver, windowPosPivot);
1417 ImGui::SetNextWindowBgAlpha(Transparency);
1418 ImGuiWindowFlags windowFlags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav;
1419#if defined(IMGUI_HAS_DOCK)
1420 windowFlags |= ImGuiWindowFlags_NoDocking;
1421#endif
1422 if (lockOverlayPositions_)
1423 windowFlags |= ImGuiWindowFlags_NoMove;
1424
1425 ImGui::Begin("Top-Right Panel", nullptr, windowFlags);
1426
1427 ImGui::Text("FPS: %.0f (%.2f ms - %.2fx)", theApplication().GetFrameTimer().GetAverageFps(), theApplication().GetFrameTimer().GetLastFrameDuration() * 1000.0f, theApplication().GetTimeMult());
1428 ImGui::Text("Frame Count: %lu", theApplication().GetFrameCount());
1429
1430#if defined(NCINE_PROFILING)
1431 const AppConfiguration& appCfg = theApplication().GetAppConfiguration();
1432 if (appCfg.withScenegraph) {
1433 const RenderStatistics::Commands& spriteCommands = RenderStatistics::GetCommands(RenderCommand::Type::Sprite);
1434 const RenderStatistics::Commands& meshspriteCommands = RenderStatistics::GetCommands(RenderCommand::Type::MeshSprite);
1435 const RenderStatistics::Commands& tileMapCommands = RenderStatistics::GetCommands(RenderCommand::Type::TileMap);
1436 const RenderStatistics::Commands& particleCommands = RenderStatistics::GetCommands(RenderCommand::Type::Particle);
1437 const RenderStatistics::Commands& lightingCommands = RenderStatistics::GetCommands(RenderCommand::Type::Lighting);
1438 const RenderStatistics::Commands& textCommands = RenderStatistics::GetCommands(RenderCommand::Type::Text);
1439 const RenderStatistics::Commands& imguiCommands = RenderStatistics::GetCommands(RenderCommand::Type::ImGui);
1440 const RenderStatistics::Commands& unspecifiedCommands = RenderStatistics::GetCommands(RenderCommand::Type::Unspecified);
1441 const RenderStatistics::Commands& allCommands = RenderStatistics::GetAllCommands();
1442
1443 ImGui::Separator();
1444 ImGui::Text("Sprites: %uV, %uDC (%u Tr), %uI/%uB", spriteCommands.vertices, spriteCommands.commands, spriteCommands.transparents, spriteCommands.instances, spriteCommands.batchSize);
1445 if (plotOverlayValues_) {
1446 ImGui::SameLine(230.0f);
1447 ImGui::PlotLines("##1", plotValues_[ValuesType::SpriteVertices].get(), numValues_, index_, nullptr, 0.0f, FLT_MAX);
1448 }
1449
1450 ImGui::Text("Mesh Sprites: %uV, %uDC (%u Tr), %uI/%uB", meshspriteCommands.vertices, meshspriteCommands.commands, meshspriteCommands.transparents, meshspriteCommands.instances, meshspriteCommands.batchSize);
1451 if (plotOverlayValues_) {
1452 ImGui::SameLine(230.0f);
1453 ImGui::PlotLines("##2", plotValues_[ValuesType::MeshSpriteVertices].get(), numValues_, index_, nullptr, 0.0f, FLT_MAX);
1454 }
1455
1456 ImGui::Text("Tile Map: %uV, %uDC (%u Tr), %uI/%uB\n", tileMapCommands.vertices, tileMapCommands.commands, tileMapCommands.transparents, tileMapCommands.instances, tileMapCommands.batchSize);
1457 if (plotOverlayValues_) {
1458 ImGui::SameLine(230.0f);
1459 ImGui::PlotLines("##3", plotValues_[ValuesType::TileMapVertices].get(), numValues_, index_, nullptr, 0.0f, FLT_MAX);
1460 }
1461
1462 ImGui::Text("Particles: %uV, %uDC (%u Tr), %uI/%uB\n", particleCommands.vertices, particleCommands.commands, particleCommands.transparents, particleCommands.instances, particleCommands.batchSize);
1463 if (plotOverlayValues_) {
1464 ImGui::SameLine(230.0f);
1465 ImGui::PlotLines("##4", plotValues_[ValuesType::ParticleVertices].get(), numValues_, index_, nullptr, 0.0f, FLT_MAX);

Callers

nothing calls this directly

Calls 5

GetAverageFpsMethod · 0.80
GetLastFrameDurationMethod · 0.80
GetFrameCountMethod · 0.80
GetTimeMultMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected