Stefan Dösinger : wined3d: Count the framerate per swapchain, not globally.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Jan 10 15:47:09 CST 2007
Module: wine
Branch: master
Commit: 222c531b1ab0e1f7024d4ecbe916e7d54795bec9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=222c531b1ab0e1f7024d4ecbe916e7d54795bec9
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Wed Jan 10 11:27:26 2007 +0100
wined3d: Count the framerate per swapchain, not globally.
---
dlls/wined3d/swapchain.c | 12 +++++-------
dlls/wined3d/wined3d_private.h | 2 ++
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 6183718..d975f26 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -307,15 +307,13 @@ static HRESULT WINAPI IWineD3DSwapChainI
/* FPS support */
if (TRACE_ON(fps))
{
- static long prev_time, frames;
-
DWORD time = GetTickCount();
- frames++;
+ This->frames++;
/* every 1.5 seconds */
- if (time - prev_time > 1500) {
- TRACE_(fps)("@ approx %.2ffps\n", 1000.0*frames/(time - prev_time));
- prev_time = time;
- frames = 0;
+ if (time - This->prev_time > 1500) {
+ TRACE_(fps)("%p @ approx %.2ffps\n", This, 1000.0*This->frames/(time - This->prev_time));
+ This->prev_time = time;
+ This->frames = 0;
}
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index c018c27..323fa38 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1313,6 +1313,8 @@ typedef struct IWineD3DSwapChainImpl
D3DPRESENT_PARAMETERS presentParms;
DWORD orig_width, orig_height;
+ long prev_time, frames; /* Performance tracking */
+
/* TODO: move everything up to drawable off into a context manager
and store the 'data' in the contextManagerData interface.
IUnknown *contextManagerData;
More information about the wine-cvs
mailing list