diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-08-10 17:14:00 +0300 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-08-11 16:40:40 +0300 |
commit | 21ec5056489f53601b3d45a0b1c79a85add42b0b (patch) | |
tree | a408abd442adf33facad99e1c50fdd5c8d3e331d /include | |
parent | ca8ffcc4562b830a02e1087e8d951b556ae315d9 (diff) | |
download | qtlocation-mapboxgl-21ec5056489f53601b3d45a0b1c79a85add42b0b.tar.gz |
add benchmark mode that shows the real frame time rather than the vsync time
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/map/map.hpp | 1 | ||||
-rw-r--r-- | include/mbgl/platform/default/glfw_view.hpp | 10 |
2 files changed, 9 insertions, 2 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index ae43dc8a8f..ebd79620d6 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -164,6 +164,7 @@ public: void setDebug(bool value); void toggleDebug(); bool getDebug() const; + void setNeedsRepaint(); void setCollisionDebug(bool value); void toggleCollisionDebug(); bool getCollisionDebug() const; diff --git a/include/mbgl/platform/default/glfw_view.hpp b/include/mbgl/platform/default/glfw_view.hpp index 1bc210b29e..ec99080732 100644 --- a/include/mbgl/platform/default/glfw_view.hpp +++ b/include/mbgl/platform/default/glfw_view.hpp @@ -12,7 +12,7 @@ class GLFWView : public mbgl::View { public: - GLFWView(bool fullscreen = false); + GLFWView(bool fullscreen = false, bool benchmark = false); ~GLFWView(); float getPixelRatio() const override; @@ -42,7 +42,7 @@ public: void setWindowTitle(const std::string&); void run(); - void fps(); + void report(float duration); private: mbgl::LatLng makeRandomPoint() const; @@ -61,9 +61,15 @@ private: private: bool fullscreen = false; + const bool benchmark = false; bool tracking = false; bool rotating = false; + // Frame timer + int frames = 0; + float frameTime = 0; + double lastReported = 0; + int width = 1024; int height = 768; int fbWidth; |