summaryrefslogtreecommitdiff
path: root/platform/default
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-08-19 15:22:13 +0200
committerKonstantin Käfer <mail@kkaefer.com>2016-08-19 17:41:55 +0200
commit0df60c46517648b18e65d860f5a9356ba751ca11 (patch)
treefbe895bed6aaac9f65ee095a48e1b12e10af5b3b /platform/default
parentcb33c861b4cfa82d7afcb5b9ec85d7797679a7d8 (diff)
downloadqtlocation-mapboxgl-0df60c46517648b18e65d860f5a9356ba751ca11.tar.gz
[core] add ability show visualize the depth buffer to the GLFW and macOS app
Diffstat (limited to 'platform/default')
-rw-r--r--platform/default/glfw_view.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/platform/default/glfw_view.cpp b/platform/default/glfw_view.cpp
index 863f42ec76..b84bbfdf8a 100644
--- a/platform/default/glfw_view.cpp
+++ b/platform/default/glfw_view.cpp
@@ -97,6 +97,7 @@ GLFWView::GLFWView(bool fullscreen_, bool benchmark_)
printf("- Press `Z` to cycle through north orientations\n");
printf("- Prezz `X` to cycle through the viewport modes\n");
printf("- Press `A` to cycle through Mapbox offices in the world + dateline monument\n");
+ printf("- Press `B` to cycle through the color, stencil, and depth buffer\n");
printf("\n");
printf("- Press `1` through `6` to add increasing numbers of point annotations for testing\n");
printf("- Press `7` through `0` to add increasing numbers of shape annotations for testing\n");
@@ -155,6 +156,18 @@ void GLFWView::onKey(GLFWwindow *window, int key, int /*scancode*/, int action,
}
}
break;
+ case GLFW_KEY_B: {
+ auto debug = view->map->getDebug();
+ if (debug & mbgl::MapDebugOptions::StencilClip) {
+ debug &= ~mbgl::MapDebugOptions::StencilClip;
+ debug |= mbgl::MapDebugOptions::DepthBuffer;
+ } else if (debug & mbgl::MapDebugOptions::DepthBuffer) {
+ debug &= ~mbgl::MapDebugOptions::DepthBuffer;
+ } else {
+ debug |= mbgl::MapDebugOptions::StencilClip;
+ }
+ view->map->setDebug(debug);
+ } break;
case GLFW_KEY_N:
if (!mods)
view->map->resetNorth();