wined3d: Count the framerate per swapchain, not globally.
This commit is contained in:
parent
9b4920996e
commit
222c531b1a
|
@ -307,15 +307,13 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
|
||||||
/* FPS support */
|
/* FPS support */
|
||||||
if (TRACE_ON(fps))
|
if (TRACE_ON(fps))
|
||||||
{
|
{
|
||||||
static long prev_time, frames;
|
|
||||||
|
|
||||||
DWORD time = GetTickCount();
|
DWORD time = GetTickCount();
|
||||||
frames++;
|
This->frames++;
|
||||||
/* every 1.5 seconds */
|
/* every 1.5 seconds */
|
||||||
if (time - prev_time > 1500) {
|
if (time - This->prev_time > 1500) {
|
||||||
TRACE_(fps)("@ approx %.2ffps\n", 1000.0*frames/(time - prev_time));
|
TRACE_(fps)("%p @ approx %.2ffps\n", This, 1000.0*This->frames/(time - This->prev_time));
|
||||||
prev_time = time;
|
This->prev_time = time;
|
||||||
frames = 0;
|
This->frames = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1313,6 +1313,8 @@ typedef struct IWineD3DSwapChainImpl
|
||||||
D3DPRESENT_PARAMETERS presentParms;
|
D3DPRESENT_PARAMETERS presentParms;
|
||||||
DWORD orig_width, orig_height;
|
DWORD orig_width, orig_height;
|
||||||
|
|
||||||
|
long prev_time, frames; /* Performance tracking */
|
||||||
|
|
||||||
/* TODO: move everything up to drawable off into a context manager
|
/* TODO: move everything up to drawable off into a context manager
|
||||||
and store the 'data' in the contextManagerData interface.
|
and store the 'data' in the contextManagerData interface.
|
||||||
IUnknown *contextManagerData;
|
IUnknown *contextManagerData;
|
||||||
|
|
Loading…
Reference in New Issue