diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2019-02-23 00:29:45 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2019-02-25 10:44:43 -0800 |
commit | 26e1c925f251d868d4bff39cd2c32b7839d02f4e (patch) | |
tree | 358df147bd4107d983f97649033c4db250c8a372 /platform/macos/src/MGLMapView.mm | |
parent | f66848efaf1efe2ce4088bf56ae7af3a765b9d57 (diff) | |
download | qtlocation-mapboxgl-26e1c925f251d868d4bff39cd2c32b7839d02f4e.tar.gz |
[ios, macos] Expose MGLMapView OpenGL context to OpenGL style layers
Added a property to MGLOpenGLStyleLayer that contains the map view’s underlying OpenGL rendering context.
Diffstat (limited to 'platform/macos/src/MGLMapView.mm')
-rw-r--r-- | platform/macos/src/MGLMapView.mm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index 482333a26c..5a24524b4a 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -707,6 +707,11 @@ public: return !_isTargetingInterfaceBuilder; } +- (CGLContextObj)context { + MGLOpenGLLayer *layer = _isTargetingInterfaceBuilder ? nil : (MGLOpenGLLayer *)self.layer; + return layer.openGLContext.CGLContextObj; +} + - (void)setFrame:(NSRect)frame { super.frame = frame; if (!_isTargetingInterfaceBuilder) { |