Module: wine Branch: master Commit: 058ebe378926b910c72d18a76d66eeddbdd64624 URL: http://source.winehq.org/git/wine.git/?a=commit;h=058ebe378926b910c72d18a76d...
Author: Stefan Dösinger stefan@codeweavers.com Date: Sun Aug 24 22:45:21 2008 -0500
winex11: Add a run-total fps counter to the fps debug channel.
---
dlls/winex11.drv/opengl.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index a68591d..3f6d131 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -3486,15 +3486,19 @@ BOOL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev) /* FPS support */ if (TRACE_ON(fps)) { - static long prev_time, frames; + static long prev_time, start_time; + static unsigned long frames, frames_total;
DWORD time = GetTickCount(); frames++; + frames_total++; /* every 1.5 seconds */ if (time - prev_time > 1500) { - TRACE_(fps)("@ approx %.2ffps\n", 1000.0*frames/(time - prev_time)); + TRACE_(fps)("@ approx %.2ffps, total %.2ffps\n", + 1000.0*frames/(time - prev_time), 1000.0*frames_total/(time - start_time)); prev_time = time; frames = 0; + if(start_time == 0) start_time = time; } }