summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorLeith Bade <leith@mapbox.com>2015-01-12 13:45:50 +1100
committerLeith Bade <leith@mapbox.com>2015-01-12 13:50:00 +1100
commitf05a530529ad57d2f97985f827657c22a9e8e6d9 (patch)
tree873da3b28f14bfb7dd6884ced5a6f39c19828e1e /platform
parent166a3e21fac8632cdf5afdf4d38bf429e45dc699 (diff)
downloadqtlocation-mapboxgl-f05a530529ad57d2f97985f827657c22a9e8e6d9.tar.gz
Correctly handle swapping. Fixes #666
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 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*/) {