summaryrefslogtreecommitdiff
path: root/include/mbgl/platform/default
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2015-05-06 15:22:43 +0300
committerKonstantin Käfer <mail@kkaefer.com>2015-05-07 11:01:15 +0200
commit168d7c4f171b44b0e3cd4ef78bc4e6b5e8181953 (patch)
tree9e3af3663f12a58071151e9405c37d04a6ab7976 /include/mbgl/platform/default
parent0d16110733a38b4e1510dce15d29c0244e7b69b6 (diff)
downloadqtlocation-mapboxgl-168d7c4f171b44b0e3cd4ef78bc4e6b5e8181953.tar.gz
Add style change functionality to the Linux test app
Makes the life of people using Linux as development environment way easier. Just press 's' to cycle through 3 different styles.
Diffstat (limited to 'include/mbgl/platform/default')
-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 46baa70023..87710ff434 100644
--- a/include/mbgl/platform/default/glfw_view.hpp
+++ b/include/mbgl/platform/default/glfw_view.hpp
@@ -25,10 +25,16 @@ public:
static void onMouseClick(GLFWwindow *window, int button, int action, int modifiers);
static void onMouseMove(GLFWwindow *window, double x, double y);
+ // Callback called when the user presses the key mapped to style change.
+ // The expected action is to set a new style, different to the current one.
+ void setChangeStyleCallback(std::function<void()> callback);
+
void run();
void fps();
-public:
+ GLFWwindow *window = nullptr;
+
+private:
bool fullscreen = false;
double lastX = 0, lastY = 0;
@@ -38,7 +44,7 @@ public:
double lastClick = -1;
- GLFWwindow *window = nullptr;
+ std::function<void()> changeStyleCallback;
};
#endif