Add a common fps counter channel to ddraw, opengl and d3d.
This commit is contained in:
parent
bb64efaf77
commit
eb527c82e2
@ -34,6 +34,7 @@
|
|||||||
|
|
||||||
/* Use the d3d_surface debug channel to have one channel for all surfaces */
|
/* Use the d3d_surface debug channel to have one channel for all surfaces */
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface);
|
WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface);
|
||||||
|
WINE_DECLARE_DEBUG_CHANNEL(fps);
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* x11_copy_to_screen
|
* x11_copy_to_screen
|
||||||
@ -379,6 +380,21 @@ IWineGDISurfaceImpl_Flip(IWineD3DSurface *iface,
|
|||||||
/* Update the screen */
|
/* Update the screen */
|
||||||
x11_copy_to_screen(This, NULL);
|
x11_copy_to_screen(This, NULL);
|
||||||
|
|
||||||
|
/* FPS support */
|
||||||
|
if (TRACE_ON(fps))
|
||||||
|
{
|
||||||
|
static long prev_time, frames;
|
||||||
|
|
||||||
|
DWORD time = GetTickCount();
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return WINED3D_OK;
|
return WINED3D_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ inline static Display *get_display( HDC hdc )
|
|||||||
|
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||||
WINE_DECLARE_DEBUG_CHANNEL(d3d_fps);
|
WINE_DECLARE_DEBUG_CHANNEL(fps);
|
||||||
|
|
||||||
|
|
||||||
/* IDirect3DSwapChain IUnknown parts follow: */
|
/* IDirect3DSwapChain IUnknown parts follow: */
|
||||||
@ -265,7 +265,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
|
|||||||
|
|
||||||
TRACE("glXSwapBuffers called, Starting new frame\n");
|
TRACE("glXSwapBuffers called, Starting new frame\n");
|
||||||
/* FPS support */
|
/* FPS support */
|
||||||
if (TRACE_ON(d3d_fps))
|
if (TRACE_ON(fps))
|
||||||
{
|
{
|
||||||
static long prev_time, frames;
|
static long prev_time, frames;
|
||||||
|
|
||||||
@ -273,7 +273,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
|
|||||||
frames++;
|
frames++;
|
||||||
/* every 1.5 seconds */
|
/* every 1.5 seconds */
|
||||||
if (time - prev_time > 1500) {
|
if (time - prev_time > 1500) {
|
||||||
TRACE_(d3d_fps)("@ approx %.2ffps\n", 1000.0*frames/(time - prev_time));
|
TRACE_(fps)("@ approx %.2ffps\n", 1000.0*frames/(time - prev_time));
|
||||||
prev_time = time;
|
prev_time = time;
|
||||||
frames = 0;
|
frames = 0;
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(wgl);
|
WINE_DEFAULT_DEBUG_CHANNEL(wgl);
|
||||||
WINE_DECLARE_DEBUG_CHANNEL(opengl);
|
WINE_DECLARE_DEBUG_CHANNEL(opengl);
|
||||||
|
WINE_DECLARE_DEBUG_CHANNEL(fps);
|
||||||
|
|
||||||
#if defined(HAVE_GL_GL_H) && defined(HAVE_GL_GLX_H)
|
#if defined(HAVE_GL_GL_H) && defined(HAVE_GL_GLX_H)
|
||||||
|
|
||||||
@ -593,6 +594,21 @@ BOOL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev)
|
|||||||
pglXSwapBuffers(gdi_display, drawable);
|
pglXSwapBuffers(gdi_display, drawable);
|
||||||
wine_tsx11_unlock();
|
wine_tsx11_unlock();
|
||||||
|
|
||||||
|
/* FPS support */
|
||||||
|
if (TRACE_ON(fps))
|
||||||
|
{
|
||||||
|
static long prev_time, frames;
|
||||||
|
|
||||||
|
DWORD time = GetTickCount();
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user