Commit 025f4aed authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Move the fps tracing to opengl32.

parent 05c32b9b
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wgl); WINE_DEFAULT_DEBUG_CHANNEL(wgl);
WINE_DECLARE_DEBUG_CHANNEL(fps);
static HMODULE opengl32_handle; static HMODULE opengl32_handle;
...@@ -603,7 +604,27 @@ BOOL WINAPI DECLSPEC_HOTPATCH wglSwapBuffers( HDC hdc ) ...@@ -603,7 +604,27 @@ BOOL WINAPI DECLSPEC_HOTPATCH wglSwapBuffers( HDC hdc )
const struct opengl_funcs *funcs = get_dc_funcs( hdc ); const struct opengl_funcs *funcs = get_dc_funcs( hdc );
if (!funcs || !funcs->wgl.p_wglSwapBuffers) return FALSE; if (!funcs || !funcs->wgl.p_wglSwapBuffers) return FALSE;
return funcs->wgl.p_wglSwapBuffers( hdc ); if (!funcs->wgl.p_wglSwapBuffers( hdc )) return FALSE;
if (TRACE_ON(fps))
{
static long prev_time, start_time;
static unsigned long frames, frames_total;
DWORD time = GetTickCount();
frames++;
frames_total++;
/* every 1.5 seconds */
if (time - prev_time > 1500)
{
TRACE_(fps)("@ approx %.2ffps, total %.2ffps\n",
1000.0*frames/(time - prev_time), 1000.0*frames_total/(time - start_time));
prev_time = time;
frames = 0;
if (start_time == 0) start_time = time;
}
}
return TRUE;
} }
/*********************************************************************** /***********************************************************************
......
...@@ -57,7 +57,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(wgl); ...@@ -57,7 +57,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(wgl);
#ifdef SONAME_LIBGL #ifdef SONAME_LIBGL
WINE_DECLARE_DEBUG_CHANNEL(winediag); WINE_DECLARE_DEBUG_CHANNEL(winediag);
WINE_DECLARE_DEBUG_CHANNEL(fps);
#include "wine/wgl_driver.h" #include "wine/wgl_driver.h"
#include "wine/wglext.h" #include "wine/wglext.h"
...@@ -3067,25 +3066,6 @@ static BOOL glxdrv_wglSwapBuffers( HDC hdc ) ...@@ -3067,25 +3066,6 @@ static BOOL glxdrv_wglSwapBuffers( HDC hdc )
ExtEscape( hdc, X11DRV_ESCAPE, sizeof(code), (LPSTR)&code, 0, NULL ); ExtEscape( hdc, X11DRV_ESCAPE, sizeof(code), (LPSTR)&code, 0, NULL );
/* FPS support */
if (TRACE_ON(fps))
{
static long prev_time, start_time;
static unsigned long frames, frames_total;
DWORD time = GetTickCount();
frames++;
frames_total++;
/* every 1.5 seconds */
if (time - prev_time > 1500) {
TRACE_(fps)("@ approx %.2ffps, total %.2ffps\n",
1000.0*frames/(time - prev_time), 1000.0*frames_total/(time - start_time));
prev_time = time;
frames = 0;
if(start_time == 0) start_time = time;
}
}
return ret; return ret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment