From fc8f33bb3ae66c1e4da7d5db0fd1a38938a0de0b Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Thu, 17 May 2018 14:54:18 -0400 Subject: add debug code for antimeridian flicker --- platform/glfw/glfw_view.cpp | 10 ++++++++++ platform/glfw/glfw_view.hpp | 1 + 2 files changed, 11 insertions(+) diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp index 362269b8e4..3eb895b8e7 100644 --- a/platform/glfw/glfw_view.cpp +++ b/platform/glfw/glfw_view.cpp @@ -54,6 +54,8 @@ GLFWView::GLFWView(bool fullscreen_, bool benchmark_) width = videoMode->width; height = videoMode->height; } + width = 800; + height = 500; glfwWindowHint(GLFW_COCOA_GRAPHICS_SWITCHING, GL_TRUE); @@ -525,6 +527,14 @@ void GLFWView::run() { } glfwPollEvents(); + auto *view = reinterpret_cast(glfwGetWindowUserPointer(window)); + if ((frameCount / 30) % 2 == 0) { + view->map->setLatLng(mbgl::LatLng(0, 170)); + } else { + view->map->setLatLng(mbgl::LatLng(0, -170)); + } + + frameCount++; if (dirty && rendererFrontend) { dirty = false; diff --git a/platform/glfw/glfw_view.hpp b/platform/glfw/glfw_view.hpp index d5acf697f7..20c584ee2f 100644 --- a/platform/glfw/glfw_view.hpp +++ b/platform/glfw/glfw_view.hpp @@ -107,6 +107,7 @@ private: int frames = 0; float frameTime = 0; double lastReported = 0; + int frameCount = 0; int width = 1024; int height = 768; -- cgit v1.2.1