diff options
author | Leith Bade <leith@mapbox.com> | 2015-01-12 13:45:50 +1100 |
---|---|---|
committer | Leith Bade <leith@mapbox.com> | 2015-01-12 13:50:00 +1100 |
commit | f05a530529ad57d2f97985f827657c22a9e8e6d9 (patch) | |
tree | 873da3b28f14bfb7dd6884ced5a6f39c19828e1e /platform | |
parent | 166a3e21fac8632cdf5afdf4d38bf429e45dc699 (diff) | |
download | qtlocation-mapboxgl-f05a530529ad57d2f97985f827657c22a9e8e6d9.tar.gz |
Correctly handle swapping. Fixes #666
Diffstat (limited to 'platform')
-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 64a33321d5..b3eed00802 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); @@ -277,12 +278,6 @@ int GLFWView::run() { map->start(); while (!glfwWindowShouldClose(window)) { - if (map->needsSwap()) { - glfwSwapBuffers(window); - map->swapped(); - fps(); - } - glfwWaitEvents(); } @@ -306,7 +301,9 @@ void GLFWView::notify() { } void GLFWView::swap() { - glfwPostEmptyEvent(); + glfwSwapBuffers(window); + map->swapped(); + fps(); } void GLFWView::notifyMapChange(mbgl::MapChange /*change*/, mbgl::timestamp /*delay*/) { |