diff --git a/dlls/wined3d/surface_gdi.c b/dlls/wined3d/surface_gdi.c index ddea727f484..bb07afa07ea 100644 --- a/dlls/wined3d/surface_gdi.c +++ b/dlls/wined3d/surface_gdi.c @@ -34,6 +34,7 @@ /* Use the d3d_surface debug channel to have one channel for all surfaces */ WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface); +WINE_DECLARE_DEBUG_CHANNEL(fps); /***************************************************************************** * x11_copy_to_screen @@ -379,6 +380,21 @@ IWineGDISurfaceImpl_Flip(IWineD3DSurface *iface, /* Update the screen */ 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; } diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index e7fd2b3aae9..3585ee3c718 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -51,7 +51,7 @@ inline static Display *get_display( HDC hdc ) WINE_DEFAULT_DEBUG_CHANNEL(d3d); -WINE_DECLARE_DEBUG_CHANNEL(d3d_fps); +WINE_DECLARE_DEBUG_CHANNEL(fps); /* IDirect3DSwapChain IUnknown parts follow: */ @@ -265,7 +265,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO TRACE("glXSwapBuffers called, Starting new frame\n"); /* FPS support */ - if (TRACE_ON(d3d_fps)) + if (TRACE_ON(fps)) { static long prev_time, frames; @@ -273,7 +273,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO frames++; /* every 1.5 seconds */ 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; frames = 0; } diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 2fe6c9dd230..486f7db3fd8 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -30,6 +30,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wgl); WINE_DECLARE_DEBUG_CHANNEL(opengl); +WINE_DECLARE_DEBUG_CHANNEL(fps); #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); 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; }