Added some vars and funcs for testing. Added more fair fps counter and frame counter

This commit is contained in:
Absolutely disgusting
2026-03-07 11:27:29 +04:00
parent c88038e38a
commit d982bc836a
6 changed files with 201 additions and 70 deletions

View File

@@ -294,6 +294,10 @@ namespace _2DGAMELIB
baseControl.SetTitle(UITitle);
Modes[mode].Setting();
FrameTimeCounter FTC = new FrameTimeCounter();
RealFpsCounter RFC = new RealFpsCounter();
/*
Action action = delegate
{
if (FPSF.Value > 1.0)
@@ -311,6 +315,28 @@ namespace _2DGAMELIB
baseControl.SetBitmap(Display);
};
*/
Action action = () =>
{
if (FPSF.Value > 1.0)
Modes[mode].Draw(FPSF);
baseControl.SetBitmap(Display);
FTC.Frame();
RFC.Frame();
if (ShowFPS)
{
baseControl.SetTitle(
UITitle +
" - FPS: " + RFC.Value.ToString("F1") +
" | Frame: " + FTC.FrameMs.ToString("F2") + " ms"
);
}
};
while (Drive)
{