diff options
Diffstat (limited to 'platform/glfw/glfw_view.cpp')
-rw-r--r-- | platform/glfw/glfw_view.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp index 9a2fefaade..74dda734c0 100644 --- a/platform/glfw/glfw_view.cpp +++ b/platform/glfw/glfw_view.cpp @@ -180,7 +180,7 @@ void GLFWView::onKey(GLFWwindow *window, int key, int /*scancode*/, int action, glfwSetWindowShouldClose(window, true); break; case GLFW_KEY_TAB: - view->map->cycleDebugOptions(); + view->cycleDebugOptions(); break; case GLFW_KEY_X: if (!mods) @@ -496,6 +496,30 @@ void GLFWView::updateAnimatedAnnotations() { } } +void GLFWView::cycleDebugOptions() { + auto debug = map->getDebug(); +#if not MBGL_USE_GLES2 + if (debug & mbgl::MapDebugOptions::StencilClip) + debug = mbgl::MapDebugOptions::NoDebug; + else if (debug & mbgl::MapDebugOptions::Overdraw) + debug = mbgl::MapDebugOptions::StencilClip; +#else + if (debug & mbgl::MapDebugOptions::Overdraw) debug = mbgl::MapDebugOptions::NoDebug; +#endif // MBGL_USE_GLES2 + else if (debug & mbgl::MapDebugOptions::Collision) + debug = mbgl::MapDebugOptions::Overdraw; + else if (debug & mbgl::MapDebugOptions::Timestamps) + debug = debug | mbgl::MapDebugOptions::Collision; + else if (debug & mbgl::MapDebugOptions::ParseStatus) + debug = debug | mbgl::MapDebugOptions::Timestamps; + else if (debug & mbgl::MapDebugOptions::TileBorders) + debug = debug | mbgl::MapDebugOptions::ParseStatus; + else + debug = mbgl::MapDebugOptions::TileBorders; + + map->setDebug(debug); +} + void GLFWView::clearAnnotations() { for (const auto& id : annotationIDs) { map->removeAnnotation(id); |