diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp index 8f3eb831d..6446a54ab 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*/) {