Skip to content

Commit

Permalink
Convert metrics to table
Browse files Browse the repository at this point in the history
  • Loading branch information
sercero committed May 1, 2024
1 parent f945777 commit e6a65d8
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions ogre_mesh_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,24 @@ 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 = {
"FPS": f"{stats.lastFPS:.2f}",
"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 e6a65d8

Please sign in to comment.