diff --git a/src/render/window.cpp b/src/render/window.cpp index ba62e4a1..4f43e3db 100644 --- a/src/render/window.cpp +++ b/src/render/window.cpp @@ -87,9 +87,6 @@ void RenderWindow::init() { } void RenderWindow::deinit() { - if (_fpsGlobal.hasAverage()) { - debug("Average FPS: " + to_string(static_cast(_fpsGlobal.average()))); - } Quad::getDefault().deinitGL(); Quad::getXFlipped().deinitGL(); Quad::getYFlipped().deinitGL(); @@ -147,12 +144,11 @@ bool RenderWindow::handleKeyDownEvent(const SDL_KeyboardEvent &event, bool &quit } void RenderWindow::update(float dt) { - _fpsLocal.update(dt); - _fpsGlobal.update(dt); + _fps.update(dt); - if (_fpsLocal.hasAverage()) { - SDL_SetWindowTitle(_window, str(boost::format("reone [FPS: %d]") % static_cast(_fpsLocal.average())).c_str()); - _fpsLocal.reset(); + if (_fps.hasAverage()) { + SDL_SetWindowTitle(_window, str(boost::format("reone [FPS: %d]") % static_cast(_fps.average())).c_str()); + _fps.reset(); } } diff --git a/src/render/window.h b/src/render/window.h index 37db20ba..92dd227c 100644 --- a/src/render/window.h +++ b/src/render/window.h @@ -59,8 +59,7 @@ private: SDL_GLContext _context { nullptr }; bool _relativeMouseMode { false }; std::shared_ptr _cursor; - FpsCounter _fpsLocal; - FpsCounter _fpsGlobal; + FpsCounter _fps; std::function _onRenderWorld; std::function _onRenderGUI;