summaryrefslogtreecommitdiff
path: root/bin/glfw.cpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-10-06 13:23:50 +0200
committerKonstantin Käfer <mail@kkaefer.com>2016-10-25 13:52:36 -0700
commit5cc390d694fc7510d445310d8eb9e32429a5e67b (patch)
tree7a24706f919ac3e8154be8b4ce33aed5bf42188d /bin/glfw.cpp
parent45f4dc0166f2d609d014d2174209fdbe1994c943 (diff)
downloadqtlocation-mapboxgl-5cc390d694fc7510d445310d8eb9e32429a5e67b.tar.gz
[core] separate Backend from View for headless rendering
Diffstat (limited to 'bin/glfw.cpp')
-rw-r--r--bin/glfw.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/glfw.cpp b/bin/glfw.cpp
index c0d61820f8..44713d7532 100644
--- a/bin/glfw.cpp
+++ b/bin/glfw.cpp
@@ -16,7 +16,7 @@
namespace {
-std::unique_ptr<GLFWView> view;
+GLFWView* view = nullptr;
}
@@ -104,7 +104,8 @@ int main(int argc, char *argv[]) {
mbgl::Log::Info(mbgl::Event::General, "BENCHMARK MODE: Some optimizations are disabled.");
}
- view = std::make_unique<GLFWView>(fullscreen, benchmark);
+ GLFWView backend(fullscreen, benchmark);
+ view = &backend;
mbgl::DefaultFileSource fileSource("/tmp/mbgl-cache.db", ".");
@@ -118,7 +119,7 @@ int main(int argc, char *argv[]) {
mbgl::ThreadPool threadPool(4);
- mbgl::Map map(*view, fileSource, threadPool);
+ mbgl::Map map(backend, backend, backend.getPixelRatio(), fileSource, threadPool);
// Load settings
mbgl::Settings_JSON settings;
@@ -181,5 +182,6 @@ int main(int argc, char *argv[]) {
"Exit location: --lat=\"%f\" --lon=\"%f\" --zoom=\"%f\" --bearing \"%f\"",
settings.latitude, settings.longitude, settings.zoom, settings.bearing);
+ view = nullptr;
return 0;
}