mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-03-03 15:31:11 +00:00
Hook up vid_fps
This commit is contained in:
parent
2403d1b7e5
commit
066f444dd0
2 changed files with 13 additions and 0 deletions
|
@ -408,6 +408,7 @@ void OpenGLFrameBuffer::Draw2D()
|
||||||
{
|
{
|
||||||
GLRenderer->mBuffers->BindCurrentFB();
|
GLRenderer->mBuffers->BindCurrentFB();
|
||||||
::DrawFullscreenBlends();
|
::DrawFullscreenBlends();
|
||||||
|
DrawRateStuff();
|
||||||
GLInterface.Draw2D(&twodgen);
|
GLInterface.Draw2D(&twodgen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,6 +126,17 @@ void DFrameBuffer::DrawRateStuff ()
|
||||||
// Draws frame time and cumulative fps
|
// Draws frame time and cumulative fps
|
||||||
if (vid_fps)
|
if (vid_fps)
|
||||||
{
|
{
|
||||||
|
FString fpsbuff = gi->statFPS();
|
||||||
|
|
||||||
|
int textScale = active_con_scale();
|
||||||
|
int rate_x = Width / textScale - NewConsoleFont->StringWidth(&fpsbuff[0]);
|
||||||
|
twod->AddColorOnlyQuad(rate_x * textScale, 0, Width, NewConsoleFont->GetHeight() * textScale, MAKEARGB(255,0,0,0));
|
||||||
|
DrawText (twod, NewConsoleFont, CR_WHITE, rate_x, 0, (char *)&fpsbuff[0],
|
||||||
|
DTA_VirtualWidth, screen->GetWidth() / textScale,
|
||||||
|
DTA_VirtualHeight, screen->GetHeight() / textScale,
|
||||||
|
DTA_KeepRatio, true, TAG_DONE);
|
||||||
|
|
||||||
|
#if 0
|
||||||
uint64_t ms = screen->FrameTime;
|
uint64_t ms = screen->FrameTime;
|
||||||
uint64_t howlong = ms - LastMS;
|
uint64_t howlong = ms - LastMS;
|
||||||
if ((signed)howlong >= 0)
|
if ((signed)howlong >= 0)
|
||||||
|
@ -154,6 +165,7 @@ void DFrameBuffer::DrawRateStuff ()
|
||||||
FrameCount++;
|
FrameCount++;
|
||||||
}
|
}
|
||||||
LastMS = ms;
|
LastMS = ms;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue