|
@@ -14,6 +14,7 @@
|
|
|
#include "game/engine/serial.hpp"
|
|
#include "game/engine/serial.hpp"
|
|
|
#include "game/engine/text_engine.hpp"
|
|
#include "game/engine/text_engine.hpp"
|
|
|
#include "game/graphics/object.hpp"
|
|
#include "game/graphics/object.hpp"
|
|
|
|
|
+#include "game/graphics/renderer.hpp"
|
|
|
|
|
|
|
|
using namespace engine;
|
|
using namespace engine;
|
|
|
|
|
|
|
@@ -24,6 +25,12 @@ fps_counter::fps_counter(std::shared_ptr<text_engine> text_engine,
|
|
|
|
|
|
|
|
fps_counter::~fps_counter() {}
|
|
fps_counter::~fps_counter() {}
|
|
|
|
|
|
|
|
|
|
+void fps_counter::render(graphics::renderer & renderer) const {
|
|
|
|
|
+ for (auto & obj : glyphs()) {
|
|
|
|
|
+ renderer.draw(obj);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
std::string fps_counter::fps(env::clock::duration const & since) const {
|
|
std::string fps_counter::fps(env::clock::duration const & since) const {
|
|
|
auto fps = magnitude_ * env::clock::duration::period::den / since.count();
|
|
auto fps = magnitude_ * env::clock::duration::period::den / since.count();
|
|
|
std::string fps_str = std::to_string(fps);
|
|
std::string fps_str = std::to_string(fps);
|