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

Expose EAGLContext to MGLOpenGLStyleLayer subclasses #12945

Closed

Description

@1ec5

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

Activity

  1. added
    iOS
    macOS
    on Sep 22, 2018
  2. self-assigned this
    on Feb 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

iOSmacOSruntime styling

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions