| 123456789101112131415161718192021222324252627282930313233 |
- //
- // fps_counter.hpp
- // engine
- //
- // Created by Sam Jaffe on 5/24/19.
- // Copyright © 2019 Sam Jaffe. All rights reserved.
- //
- #pragma once
- #include <vector>
- #include "game/graphics/graphics_fwd.h"
- #include "game/util/time.hpp"
- namespace engine {
- class fps_counter {
- public:
- fps_counter(env::clock::duration const & fpscap,
- graphics::manager const & mgr, std::size_t precision = 3);
- ~fps_counter();
- void set_frame_step(env::clock::duration const & since);
- std::vector<graphics::object> const & glyphs() const { return glyphs_; }
- private:
- int counter_{0}, change_after_{10};
- std::size_t digits_;
- std::size_t magnitude_;
- std::vector<graphics::object> glyphs_;
- };
- }
|