win32: add a 3d fps counter so you can see how fast the game logic is running. this isnt as good as a proper lag counter

This commit is contained in:
zeromus 2009-03-25 04:51:07 +00:00
parent c1c5ff3b0e
commit f302f00e0d
3 changed files with 20 additions and 2 deletions

View File

@ -1323,6 +1323,8 @@ static void gfx3d_FlushFIFO()
void gfx3d_glFlush(u32 v) void gfx3d_glFlush(u32 v)
{ {
gfx3d.frameCtr++;
gfx3d_FlushFIFO(); gfx3d_FlushFIFO();
//assert(!flushPending); //assert(!flushPending);

View File

@ -133,6 +133,8 @@ struct GFX3D
, alphaTestRef(0) , alphaTestRef(0)
, clearDepth(1) , clearDepth(1)
, clearColor(0) , clearColor(0)
, frameCtr(0)
, frameCtrRaw(0)
{ {
fogColor[0] = fogColor[1] = fogColor[2] = fogColor[3] = 0; fogColor[0] = fogColor[1] = fogColor[2] = fogColor[3] = 0;
fogOffset = 0; fogOffset = 0;
@ -163,6 +165,11 @@ struct GFX3D
float fogColor[4]; float fogColor[4];
float fogOffset; float fogOffset;
//ticks every time flush() is called
int frameCtr;
//you can use this to track how many real frames passed, for comparing to frameCtr;
int frameCtrRaw;
u32 rgbToonTable[32]; u32 rgbToonTable[32];
}; };

View File

@ -889,13 +889,22 @@ DWORD WINAPI run()
// if (!skipnextframe) // if (!skipnextframe)
// { // {
if (FpsDisplay) osd->addFixed(0, 5, "%02d Fps", fps); static int fps3d = 0;
if (FpsDisplay) osd->addFixed(0, 5, "%02d Fps / %02d 3d", fps, fps3d);
osd->update(); osd->update();
Display(); Display();
osd->clear(); osd->clear();
gfx3d.frameCtrRaw++;
if(gfx3d.frameCtrRaw == 60) {
fps3d = gfx3d.frameCtr;
gfx3d.frameCtrRaw = 0;
gfx3d.frameCtr = 0;
}
fpsframecount++; fpsframecount++;
QueryPerformanceCounter((LARGE_INTEGER *)&curticks); QueryPerformanceCounter((LARGE_INTEGER *)&curticks);