diff --git a/olcPixelGameEngine.h b/olcPixelGameEngine.h index 37ffb75..f2a8ee2 100644 --- a/olcPixelGameEngine.h +++ b/olcPixelGameEngine.h @@ -1111,6 +1111,7 @@ namespace olc std::string TextEntryGetString() const; int32_t TextEntryGetCursor() const; bool IsTextEntryEnabled() const; + void SetFPSDisplay(bool display); @@ -1172,7 +1173,8 @@ namespace olc bool bEnableVSYNC = false; float fFrameTimer = 1.0f; float fLastElapsed = 0.0f; - int nFrameCount = 0; + int nFrameCount = 0; + bool showFPS = true; bool bSuspendTextureTransfer = false; Renderable fontRenderable; std::vector vLayers; @@ -3198,6 +3200,8 @@ namespace olc bool PixelGameEngine::IsTextEntryEnabled() const { return bTextEntryEnable; } + void PixelGameEngine::SetFPSDisplay(bool display) + { showFPS=display; } void PixelGameEngine::UpdateTextEntry() @@ -3536,7 +3540,7 @@ namespace olc { nLastFPS = nFrameCount; fFrameTimer -= 1.0f; - std::string sTitle = "OneLoneCoder.com - Pixel Game Engine - " + sAppName + " - FPS: " + std::to_string(nFrameCount); + std::string sTitle = "OneLoneCoder.com - Pixel Game Engine - " + sAppName + ((showFPS)?" - FPS: " + std::to_string(nFrameCount):""); platform->SetWindowTitle(sTitle); nFrameCount = 0; }