summaryrefslogtreecommitdiff
path: root/platform/glfw/main.cpp
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2017-02-24 15:07:13 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2017-02-25 14:03:38 +0200
commit92e6e48699f5f94a80d69a94202f0f9c803fa2a7 (patch)
tree43d98fcea65b0b6fc9e8697310c9135810b40606 /platform/glfw/main.cpp
parent4c2e720b1522d2a45980ac8dcf34d2a3783cf426 (diff)
downloadqtlocation-mapboxgl-92e6e48699f5f94a80d69a94202f0f9c803fa2a7.tar.gz
[glfw] Make P pause/resume the network thread
Simple test of the DefaultFileSource pause/resume API.
Diffstat (limited to 'platform/glfw/main.cpp')
-rw-r--r--platform/glfw/main.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/platform/glfw/main.cpp b/platform/glfw/main.cpp
index 1f683b185f..fbfba0b7fb 100644
--- a/platform/glfw/main.cpp
+++ b/platform/glfw/main.cpp
@@ -153,6 +153,18 @@ int main(int argc, char *argv[]) {
mbgl::Log::Info(mbgl::Event::Setup, "Changed style to: %s", newStyle.name);
});
+ view->setPauseResumeCallback([&fileSource] () {
+ static bool isPaused = false;
+
+ if (isPaused) {
+ fileSource.resume();
+ } else {
+ fileSource.pause();
+ }
+
+ isPaused = !isPaused;
+ });
+
// Load style
if (style.empty()) {
const char *url = getenv("MAPBOX_STYLE_URL");