summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorLeith Bade <leith@mapbox.com>2015-01-13 19:48:26 +1100
committerLeith Bade <leith@mapbox.com>2015-01-13 19:48:26 +1100
commit7cce089d7809d2e3c64c8119969771e151a4add9 (patch)
treecc6d0505bfcbc622290b69a007d92c93b399b372 /platform
parentaa955171d70f1fddc1e4531b9df32a3cfd5caf93 (diff)
parentf20a17a2919fffc4baa9dadc294c3ebb4459a2ff (diff)
downloadqtlocation-mapboxgl-7cce089d7809d2e3c64c8119969771e151a4add9.tar.gz
Merge branch 'master' of github.com:mapbox/mapbox-gl-native into android-mason
Diffstat (limited to 'platform')
-rw-r--r--platform/default/glfw_view.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp
index 295e106621..1118bc23a7 100644
--- a/platform/default/glfw_view.cpp
+++ b/platform/default/glfw_view.cpp
@@ -58,13 +58,11 @@ void GLFWView::initialize(mbgl::Map *map_) {
glfwSetWindowUserPointer(window, this);
glfwMakeContextCurrent(window);
+ glfwSwapInterval(1);
int width, height;
glfwGetWindowSize(window, &width, &height);
- int fbWidth, fbHeight;
- glfwGetFramebufferSize(window, &fbWidth, &fbHeight);
-
- resize(window, 0, 0);
+ resize(window, width, height);
glfwSetCursorPosCallback(window, mouseMove);
glfwSetMouseButtonCallback(window, mouseClick);
@@ -281,12 +279,6 @@ int GLFWView::run() {
map->start();
while (!glfwWindowShouldClose(window)) {
- if (map->needsSwap()) {
- glfwSwapBuffers(window);
- map->swapped();
- fps();
- }
-
glfwWaitEvents();
}
@@ -310,7 +302,9 @@ void GLFWView::notify() {
}
void GLFWView::swap() {
- glfwPostEmptyEvent();
+ glfwSwapBuffers(window);
+ map->swapped();
+ fps();
}
void GLFWView::notifyMapChange(mbgl::MapChange /*change*/, mbgl::timestamp /*delay*/) {