Skip to content

Commit

Permalink
Convert metrics to table
Browse files Browse the repository at this point in the history
  • Loading branch information
sercero authored and paroj committed May 2, 2024
1 parent f945777 commit 553c9c7
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions ogre_mesh_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,23 @@ def draw_metrics(self):
ImGui.WindowFlags_AlwaysAutoResize | ImGui.WindowFlags_NoSavedSettings | ImGui.WindowFlags_NoFocusOnAppearing | \
ImGui.WindowFlags_NoNav
self.show_metrics = ImGui.Begin("Metrics", self.show_metrics, flags)[1]

stats_dict = {
"Average FPS": f"{stats.avgFPS:.2f}",
"Batches": f"{stats.batchCount}",
"Triangles": f"{stats.triangleCount}"
}

ImGui.Text("Metrics")
ImGui.Separator()
ImGui.Text(f"Average FPS: {stats.avgFPS:.2f}")
ImGui.Text(f"Batches: {stats.batchCount}")
ImGui.Text(f"Triangles: {stats.triangleCount}")
if ImGui.BeginTable("Metrics", 2):
for stat, value in stats_dict.items():
ImGui.TableNextRow()
ImGui.TableSetColumnIndex(0)
ImGui.Text(stat)
ImGui.TableSetColumnIndex(1)
ImGui.Text(value)
ImGui.EndTable()
ImGui.End()

def draw_loading(self):
Expand Down

0 comments on commit 553c9c7

Please sign in to comment.