wined3d: Count the framerate per swapchain, not globally.

This commit is contained in:
Stefan Dösinger 2007-01-10 11:27:26 +01:00 committed by Alexandre Julliard
parent 9b4920996e
commit 222c531b1a
2 changed files with 7 additions and 7 deletions

View File

@ -307,15 +307,13 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
/* 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;
}
}

View File

@ -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;