diff options
Diffstat (limited to 'StarsEx/GameWinDX9.cpp')
-rw-r--r-- | StarsEx/GameWinDX9.cpp | 36 |
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 { |