summaryrefslogtreecommitdiffhomepage
path: root/StarsEx/GameWinDX9.cpp
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-04-03 17:24:16 +0200
committerAki <please@ignore.pl>2022-04-03 17:24:16 +0200
commitcd57c84c5fe34c2ac548d6d119a9828a303923ef (patch)
treeaac3545bcb95bf0d30b8b356c91adc492c07d3a6 /StarsEx/GameWinDX9.cpp
parent150bd957db8eb19b1a07643317767ff5c3007f48 (diff)
downloadstarshatter-cd57c84c5fe34c2ac548d6d119a9828a303923ef.zip
starshatter-cd57c84c5fe34c2ac548d6d119a9828a303923ef.tar.gz
starshatter-cd57c84c5fe34c2ac548d6d119a9828a303923ef.tar.bz2
Removed video stats in Game
Diffstat (limited to 'StarsEx/GameWinDX9.cpp')
-rw-r--r--StarsEx/GameWinDX9.cpp36
1 files changed, 34 insertions, 2 deletions
diff --git a/StarsEx/GameWinDX9.cpp b/StarsEx/GameWinDX9.cpp
index 9a63e36..671464e 100644
--- a/StarsEx/GameWinDX9.cpp
+++ b/StarsEx/GameWinDX9.cpp
@@ -70,8 +70,6 @@ GameWinDX9::Init(HINSTANCE hi, HINSTANCE hpi, LPSTR cmdline, int nCmdShow)
Print(" Initializing Game\n");
- stats.Clear();
-
if (!InitApplication(hInst)) { // Initialize shared things
Panic::Panic("Could not initialize the application.");
status = INIT_FAILED;
@@ -581,6 +579,40 @@ GameWinDX9::Run()
}
+void
+GameWinDX9::ShowStats()
+{
+ if (server) return;
+
+ auto total_time = Clock::GetInstance()->RealTime();
+ auto stats = Video::GetInstance()->GetStats();
+
+ Print("\n");
+ Print("Performance Data:\n");
+ Print("-----------------\n");
+
+ Print(" Time: %d msec\n", total_time);
+ Print(" Frames: %d\n", stats.nframe);
+ Print(" Polys Rendered: %d\n", stats.total_polys);
+ Print(" Lines Rendered: %d\n", stats.total_lines);
+ Print(" Verts Rendered: %d\n", stats.total_verts);
+ Print(" Render Calls: %d\n", stats.ncalls);
+ Print("\n");
+
+ Print("Performance Statistics:\n");
+ Print("-----------------------\n");
+
+ Print(" Frames/Second: %.2f\n", (stats.nframe * 1000.0) / total_time);
+ Print(" Polys/Frame: %.2f\n", (double) stats.total_polys / (double) stats.nframe);
+ Print(" Polys/Call: %.2f\n", (double) stats.total_polys / (double) stats.ncalls);
+ Print(" Polys/Second: %.2f\n", (stats.total_polys * 1000.0) / total_time);
+ Print(" Lines/Second: %.2f\n", (stats.total_lines * 1000.0) / total_time);
+ Print(" Verts/Second: %.2f\n", (stats.total_verts * 1000.0) / total_time);
+
+ Print("\n");
+}
+
+
int
GameWinDX9::MaxTexSize() const
{