diff options
-rw-r--r-- | include/mbgl/platform/default/glfw_view.hpp | 4 | ||||
-rw-r--r-- | platform/default/glfw_view.cpp | 7 |
2 files changed, 4 insertions, 7 deletions
diff --git a/include/mbgl/platform/default/glfw_view.hpp b/include/mbgl/platform/default/glfw_view.hpp index 74a545d31b..3b74618e3e 100644 --- a/include/mbgl/platform/default/glfw_view.hpp +++ b/include/mbgl/platform/default/glfw_view.hpp @@ -11,8 +11,6 @@ #define GL_GLEXT_PROTOTYPES #include <GLFW/glfw3.h> -#include <atomic> - class GLFWView : public mbgl::View { public: GLFWView(bool fullscreen = false, bool benchmark = false); @@ -95,7 +93,7 @@ private: mbgl::util::Timer frameTick; GLFWwindow *window = nullptr; - std::atomic_flag clean = ATOMIC_FLAG_INIT; + bool dirty = false; }; #endif diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp index bdadaa6f36..7fb47ff7c9 100644 --- a/platform/default/glfw_view.cpp +++ b/platform/default/glfw_view.cpp @@ -417,15 +417,12 @@ void GLFWView::onMouseMove(GLFWwindow *window, double x, double y) { void GLFWView::run() { auto callback = [&] { if (glfwWindowShouldClose(window)) { - frameTick.stop(); runLoop.stop(); - return; } glfwPollEvents(); - const bool dirty = !clean.test_and_set(); if (dirty) { const double started = glfwGetTime(); @@ -444,6 +441,8 @@ void GLFWView::run() { if (benchmark) { map->update(mbgl::Update::Repaint); } + + dirty = false; } }; @@ -476,7 +475,7 @@ void GLFWView::deactivate() { } void GLFWView::invalidate() { - clean.clear(); + dirty = true; glfwPostEmptyEvent(); } |