From 168d7c4f171b44b0e3cd4ef78bc4e6b5e8181953 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Wed, 6 May 2015 15:22:43 +0300 Subject: 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. --- include/mbgl/platform/default/glfw_view.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include/mbgl/platform/default') 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 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 changeStyleCallback; }; #endif -- cgit v1.2.1