summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorLeith Bade <leith@mapbox.com>2015-01-13 09:23:28 +1100
committerLeith Bade <leith@mapbox.com>2015-01-13 09:23:28 +1100
commitf20a17a2919fffc4baa9dadc294c3ebb4459a2ff (patch)
tree2518c6c71c53c47569c2a21935f43ecf6ee8fee8 /platform
parentbac75f1c7aa9e7d1a2e1a1a7c5db02b2dabefc44 (diff)
parentf05a530529ad57d2f97985f827657c22a9e8e6d9 (diff)
downloadqtlocation-mapboxgl-f20a17a2919fffc4baa9dadc294c3ebb4459a2ff.tar.gz
Merge pull request #748 from mapbox/fix-swap
Correctly handle swapping
Diffstat (limited to 'platform')
-rw-r--r--platform/default/glfw_view.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp
index 8f3eb831d4..6446a54abb 100644
--- a/platform/default/glfw_view.cpp
+++ b/platform/default/glfw_view.cpp
@@ -58,6 +58,7 @@ void GLFWView::initialize(mbgl::Map *map_) {
glfwSetWindowUserPointer(window, this);
glfwMakeContextCurrent(window);
+ glfwSwapInterval(1);
int width, height;
glfwGetWindowSize(window, &width, &height);
@@ -274,12 +275,6 @@ int GLFWView::run() {
map->start();
while (!glfwWindowShouldClose(window)) {
- if (map->needsSwap()) {
- glfwSwapBuffers(window);
- map->swapped();
- fps();
- }
-
glfwWaitEvents();
}
@@ -303,7 +298,9 @@ void GLFWView::notify() {
}
void GLFWView::swap() {
- glfwPostEmptyEvent();
+ glfwSwapBuffers(window);
+ map->swapped();
+ fps();
}
void GLFWView::notifyMapChange(mbgl::MapChange /*change*/, mbgl::timestamp /*delay*/) {