diff options
author | Leith Bade <leith@mapbox.com> | 2015-01-13 09:23:28 +1100 |
---|---|---|
committer | Leith Bade <leith@mapbox.com> | 2015-01-13 09:23:28 +1100 |
commit | f20a17a2919fffc4baa9dadc294c3ebb4459a2ff (patch) | |
tree | 2518c6c71c53c47569c2a21935f43ecf6ee8fee8 | |
parent | bac75f1c7aa9e7d1a2e1a1a7c5db02b2dabefc44 (diff) | |
parent | f05a530529ad57d2f97985f827657c22a9e8e6d9 (diff) | |
download | qtlocation-mapboxgl-f20a17a2919fffc4baa9dadc294c3ebb4459a2ff.tar.gz |
Merge pull request #748 from mapbox/fix-swap
Correctly handle swapping
-rw-r--r-- | platform/default/glfw_view.cpp | 11 |
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*/) { |