diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-08-19 15:22:13 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2016-08-19 17:41:55 +0200 |
commit | 0df60c46517648b18e65d860f5a9356ba751ca11 (patch) | |
tree | fbe895bed6aaac9f65ee095a48e1b12e10af5b3b /platform/macos/app/MapDocument.m | |
parent | cb33c861b4cfa82d7afcb5b9ec85d7797679a7d8 (diff) | |
download | qtlocation-mapboxgl-0df60c46517648b18e65d860f5a9356ba751ca11.tar.gz |
[core] add ability show visualize the depth buffer to the GLFW and macOS app
Diffstat (limited to 'platform/macos/app/MapDocument.m')
-rw-r--r-- | platform/macos/app/MapDocument.m | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/platform/macos/app/MapDocument.m b/platform/macos/app/MapDocument.m index 9e65539990..3bb8f5872e 100644 --- a/platform/macos/app/MapDocument.m +++ b/platform/macos/app/MapDocument.m @@ -283,12 +283,19 @@ NS_ARRAY_OF(id <MGLAnnotation>) *MBXFlattenedShapes(NS_ARRAY_OF(id <MGLAnnotatio - (IBAction)showColorBuffer:(id)sender { self.mapView.debugMask &= ~MGLMapDebugStencilBufferMask; + self.mapView.debugMask &= ~MGLMapDebugDepthBufferMask; } - (IBAction)showStencilBuffer:(id)sender { + self.mapView.debugMask &= ~MGLMapDebugDepthBufferMask; self.mapView.debugMask |= MGLMapDebugStencilBufferMask; } +- (IBAction)showDepthBuffer:(id)sender { + self.mapView.debugMask &= ~MGLMapDebugStencilBufferMask; + self.mapView.debugMask |= MGLMapDebugDepthBufferMask; +} + - (IBAction)toggleShowsToolTipsOnDroppedPins:(id)sender { _showsToolTipsOnDroppedPins = !_showsToolTipsOnDroppedPins; } @@ -642,7 +649,7 @@ NS_ARRAY_OF(id <MGLAnnotation>) *MBXFlattenedShapes(NS_ARRAY_OF(id <MGLAnnotatio return YES; } if (menuItem.action == @selector(showColorBuffer:)) { - BOOL enabled = self.mapView.debugMask & MGLMapDebugStencilBufferMask; + BOOL enabled = self.mapView.debugMask & (MGLMapDebugStencilBufferMask | MGLMapDebugDepthBufferMask); menuItem.state = enabled ? NSOffState : NSOnState; return YES; } @@ -651,6 +658,11 @@ NS_ARRAY_OF(id <MGLAnnotation>) *MBXFlattenedShapes(NS_ARRAY_OF(id <MGLAnnotatio menuItem.state = enabled ? NSOnState : NSOffState; return YES; } + if (menuItem.action == @selector(showDepthBuffer:)) { + BOOL enabled = self.mapView.debugMask & MGLMapDebugDepthBufferMask; + menuItem.state = enabled ? NSOnState : NSOffState; + return YES; + } if (menuItem.action == @selector(toggleShowsToolTipsOnDroppedPins:)) { BOOL isShown = _showsToolTipsOnDroppedPins; menuItem.title = isShown ? @"Hide Tooltips on Dropped Pins" : @"Show Tooltips on Dropped Pins"; |