Added some vars and funcs for testing. Added more fair fps counter and frame counter
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user