summaryrefslogtreecommitdiff
path: root/include/mbgl/platform
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-08-10 17:14:00 +0300
committerKonstantin Käfer <mail@kkaefer.com>2015-08-11 16:40:40 +0300
commit21ec5056489f53601b3d45a0b1c79a85add42b0b (patch)
treea408abd442adf33facad99e1c50fdd5c8d3e331d /include/mbgl/platform
parentca8ffcc4562b830a02e1087e8d951b556ae315d9 (diff)
downloadqtlocation-mapboxgl-21ec5056489f53601b3d45a0b1c79a85add42b0b.tar.gz
add benchmark mode that shows the real frame time rather than the vsync time
Diffstat (limited to 'include/mbgl/platform')
-rw-r--r--include/mbgl/platform/default/glfw_view.hpp10
1 files changed, 8 insertions, 2 deletions
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;