summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJustin R. Miller <incanus@codesorcery.net>2014-07-16 18:18:04 -0700
committerJustin R. Miller <incanus@codesorcery.net>2014-07-16 18:18:04 -0700
commita902446e7f6d45c4b0a707f1adf4ea607b64f081 (patch)
tree9f1ed9992461c53ab643b7085c87fb2d3ea24c90 /common
parent3adad61b82ed140195756a5fce6717d0c63e79d9 (diff)
downloadqtlocation-mapboxgl-a902446e7f6d45c4b0a707f1adf4ea607b64f081.tar.gz
refs #342 & #346: per-map change callbacks
Diffstat (limited to 'common')
-rw-r--r--common/glfw_view.cpp10
-rw-r--r--common/glfw_view.hpp2
-rw-r--r--common/headless_view.cpp16
-rw-r--r--common/headless_view.hpp2
4 files changed, 12 insertions, 18 deletions
diff --git a/common/glfw_view.cpp b/common/glfw_view.cpp
index 0d26928e08..ae992d9268 100644
--- a/common/glfw_view.cpp
+++ b/common/glfw_view.cpp
@@ -1,7 +1,5 @@
#include "glfw_view.hpp"
-#include <llmr/util/time.hpp>
-
GLFWView::GLFWView(bool fullscreen) : fullscreen(fullscreen) {
#ifdef NVIDIA
glDiscardFramebufferEXT = (PFNGLDISCARDFRAMEBUFFEREXTPROC)glfwGetProcAddress("glDiscardFramebufferEXT");
@@ -196,6 +194,10 @@ void GLFWView::swap() {
glfwPostEmptyEvent();
}
+void GLFWView::notify_map_change(llmr::MapChange change, llmr::timestamp delay) {
+ // no-op
+}
+
void GLFWView::fps() {
static int frames = 0;
static double time_elapsed = 0;
@@ -283,9 +285,5 @@ void show_color_debug_image(std::string name, const char *data, size_t logical_w
}
#endif
-void notify_map_change(MapChange change, timestamp delay) {
- // no-op
-}
-
}
}
diff --git a/common/glfw_view.hpp b/common/glfw_view.hpp
index 62da124caa..05a4063289 100644
--- a/common/glfw_view.hpp
+++ b/common/glfw_view.hpp
@@ -2,6 +2,7 @@
#define LLMR_COMMON_GLFW_VIEW
#include <llmr/llmr.hpp>
+#include <llmr/util/time.hpp>
#ifdef NVIDIA
#define GLFW_INCLUDE_ES2
@@ -18,6 +19,7 @@ public:
void initialize(llmr::Map *map);
void swap();
void make_active();
+ void notify_map_change(llmr::MapChange change, llmr::timestamp delay = 0);
static void key(GLFWwindow *window, int key, int scancode, int action, int mods);
static void scroll(GLFWwindow *window, double xoffset, double yoffset);
diff --git a/common/headless_view.cpp b/common/headless_view.cpp
index 2ca804664e..6c4054303a 100644
--- a/common/headless_view.cpp
+++ b/common/headless_view.cpp
@@ -1,17 +1,5 @@
#include "headless_view.hpp"
-#include <llmr/util/time.hpp>
#include <llmr/util/timer.hpp>
-#include <llmr/platform/platform.hpp>
-
-namespace llmr {
-
-namespace platform {
-
-void notify_map_change(MapChange change, timestamp delay) {
- // no-op
-}
-
-}
HeadlessView::HeadlessView() {
#if LLMR_USE_CGL
@@ -161,6 +149,10 @@ HeadlessView::~HeadlessView() {
#endif
}
+void HeadlessView::notify_map_change(llmr::MapChange change, llmr::timestamp delay) {
+ // no-op
+}
+
void HeadlessView::make_active() {
#if LLMR_USE_CGL
CGLError error = CGLSetCurrentContext(gl_context);
diff --git a/common/headless_view.hpp b/common/headless_view.hpp
index b3e1c11b9b..efbc08df1b 100644
--- a/common/headless_view.hpp
+++ b/common/headless_view.hpp
@@ -10,6 +10,7 @@
#include <llmr/map/view.hpp>
#include <llmr/platform/gl.hpp>
+#include <llmr/util/time.hpp>
namespace llmr {
@@ -20,6 +21,7 @@ public:
void resize(int width, int height);
+ void notify_map_change(MapChange change, timestamp delay = 0);
void make_active();
void swap();
unsigned int root_fbo();