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:
parent
c1c5ff3b0e
commit
f302f00e0d
|
@ -1323,6 +1323,8 @@ static void gfx3d_FlushFIFO()
|
|||
|
||||
void gfx3d_glFlush(u32 v)
|
||||
{
|
||||
gfx3d.frameCtr++;
|
||||
|
||||
gfx3d_FlushFIFO();
|
||||
|
||||
//assert(!flushPending);
|
||||
|
|
|
@ -133,6 +133,8 @@ struct GFX3D
|
|||
, alphaTestRef(0)
|
||||
, clearDepth(1)
|
||||
, clearColor(0)
|
||||
, frameCtr(0)
|
||||
, frameCtrRaw(0)
|
||||
{
|
||||
fogColor[0] = fogColor[1] = fogColor[2] = fogColor[3] = 0;
|
||||
fogOffset = 0;
|
||||
|
@ -163,6 +165,11 @@ struct GFX3D
|
|||
float fogColor[4];
|
||||
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];
|
||||
};
|
||||
|
|
|
@ -890,12 +890,21 @@ DWORD WINAPI run()
|
|||
// if (!skipnextframe)
|
||||
// {
|
||||
|
||||
static int fps3d = 0;
|
||||
|
||||
if (FpsDisplay) osd->addFixed(0, 5, "%02d Fps", fps);
|
||||
if (FpsDisplay) osd->addFixed(0, 5, "%02d Fps / %02d 3d", fps, fps3d);
|
||||
osd->update();
|
||||
Display();
|
||||
osd->clear();
|
||||
|
||||
gfx3d.frameCtrRaw++;
|
||||
if(gfx3d.frameCtrRaw == 60) {
|
||||
fps3d = gfx3d.frameCtr;
|
||||
gfx3d.frameCtrRaw = 0;
|
||||
gfx3d.frameCtr = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
fpsframecount++;
|
||||
QueryPerformanceCounter((LARGE_INTEGER *)&curticks);
|
||||
|
|
Loading…
Reference in New Issue