Merge pull request #748 from mapbox/fix-swap

Correctly handle swapping
This commit is contained in:
Leith Bade
2015-01-13 09:23:28 +11:00

View File

@@ -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*/) {