Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Expose EAGLContext to MGLOpenGLStyleLayer subclasses #12945

Closed
1ec5 opened this issue Sep 22, 2018 · 0 comments
Closed

Expose EAGLContext to MGLOpenGLStyleLayer subclasses #12945

1ec5 opened this issue Sep 22, 2018 · 0 comments
Assignees
Labels
iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS runtime styling

Comments

@1ec5
Copy link
Contributor

1ec5 commented Sep 22, 2018

MGLOpenGLStyleLayer should have a read-only EAGLContext property of type EAGLContext.

As seen in mapbox/ios-sdk-examples#111 (comment), it’s possible to integrate an SCNRenderer into an MGLOpenGLStyleLayer in order to render 3D SceneKit content into a style layer. However, it currently requires forward-declaring the MGLMapView.glView property, which is of type GLKView, so that an MGLOpenGLStyleLayer subclass can pass the GLKView.context property into +[SCNRenderer rendererWithContext:options:].

@property (nonatomic) GLKView *glView;

MGLMapView.glView is an implementation detail that under ordinary circumstances shouldn’t be exposed to developers, especially not in light of a future Metal migration. However, MGLOpenGLStyleLayer is all about exposing OpenGL ES–specific implementation details, so it should have access to its EAGLContext.

The implementation of MGLOpenGLStyleLayer.EAGLContext would consist of returning self.style.mapView.glView.context. MGLMapView.glView’s declaration would need to be moved to MGLMapView_Private.h.

/cc @fabian-guerra @jmkiley

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS runtime styling
Projects
None yet
Development

No branches or pull requests

1 participant