From 26e1c925f251d868d4bff39cd2c32b7839d02f4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Sat, 23 Feb 2019 00:29:45 -0800 Subject: [ios, macos] Expose MGLMapView OpenGL context to OpenGL style layers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added a property to MGLOpenGLStyleLayer that contains the map view’s underlying OpenGL rendering context. --- platform/macos/src/MGLMapView.mm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'platform/macos/src/MGLMapView.mm') 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) { -- cgit v1.2.1