From: Zebediah Figura zfigura@codeweavers.com
This usually doesn't go through the normal presentation paths. --- dlls/ddraw/ddraw_private.h | 3 +++ dlls/ddraw/surface.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+)
diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index 0c2a491d45b..159ce987dc3 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -136,6 +136,9 @@ struct ddraw
struct wined3d_stateblock *state; const struct wined3d_stateblock_state *stateblock_state; + + unsigned int frames; + DWORD prev_frame_time; };
#define DDRAW_WINDOW_CLASS_NAME "DirectDrawDeviceWnd" diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index e4382a74ecd..4a95067996f 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -24,6 +24,7 @@ #include "ddraw_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(ddraw); +WINE_DECLARE_DEBUG_CHANNEL(fps);
static struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface2(IDirectDrawSurface2 *iface); static struct ddraw_surface *unsafe_impl_from_IDirectDrawSurface3(IDirectDrawSurface3 *iface); @@ -87,6 +88,21 @@ HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface, if (w <= 0 || h <= 0) return DD_OK;
+ if (!read && TRACE_ON(fps)) + { + DWORD time = GetTickCount(); + ++ddraw->frames; + + /* every 1.5 seconds */ + if (time - ddraw->prev_frame_time > 1500) + { + TRACE_(fps)("%p @ approx %.2ffps\n", + ddraw, 1000.0 * ddraw->frames / (time - ddraw->prev_frame_time)); + ddraw->prev_frame_time = time; + ddraw->frames = 0; + } + } + /* The interaction between ddraw and GDI drawing is not all that well * documented, and somewhat arcane. In ddraw exclusive mode, GDI draws * seemingly go to the *original* frontbuffer/primary surface, while ddraw