chore(render): Drop the global FPS counter

This commit is contained in:
Vsevolod Kremianskii 2021-01-30 16:01:28 +07:00
parent 36c6946e26
commit 170cca7c59
2 changed files with 5 additions and 10 deletions

View file

@ -87,9 +87,6 @@ void RenderWindow::init() {
}
void RenderWindow::deinit() {
if (_fpsGlobal.hasAverage()) {
debug("Average FPS: " + to_string(static_cast<int>(_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<int>(_fpsLocal.average())).c_str());
_fpsLocal.reset();
if (_fps.hasAverage()) {
SDL_SetWindowTitle(_window, str(boost::format("reone [FPS: %d]") % static_cast<int>(_fps.average())).c_str());
_fps.reset();
}
}

View file

@ -59,8 +59,7 @@ private:
SDL_GLContext _context { nullptr };
bool _relativeMouseMode { false };
std::shared_ptr<Cursor> _cursor;
FpsCounter _fpsLocal;
FpsCounter _fpsGlobal;
FpsCounter _fps;
std::function<void()> _onRenderWorld;
std::function<void()> _onRenderGUI;