diff options
Diffstat (limited to 'platform/macos')
-rw-r--r-- | platform/macos/src/MGLMapView.mm | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index ef1c0f3bc1..45ac7c5357 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -26,7 +26,6 @@ #import <mbgl/map/camera.hpp> #import <mbgl/storage/reachability.h> #import <mbgl/util/default_thread_pool.hpp> -#import <mbgl/gl/extension.hpp> #import <mbgl/gl/context.hpp> #import <mbgl/map/backend.hpp> #import <mbgl/map/backend_scope.hpp> @@ -768,19 +767,6 @@ public: - (void)renderSync { if (!self.dormant) { - // Enable vertex buffer objects. - mbgl::gl::InitializeExtensions([](const char *name) { - static CFBundleRef framework = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengl")); - if (!framework) { - throw std::runtime_error("Failed to load OpenGL framework."); - } - - CFStringRef str = CFStringCreateWithCString(kCFAllocatorDefault, name, kCFStringEncodingASCII); - void *symbol = CFBundleGetFunctionPointerForName(framework, str); - CFRelease(str); - - return reinterpret_cast<mbgl::gl::glProc>(symbol); - }); // The OpenGL implementation automatically enables the OpenGL context for us. mbgl::BackendScope scope { *_mbglView, mbgl::BackendScope::ScopeType::Implicit }; @@ -2846,6 +2832,19 @@ public: [nativeView sourceDidChange]; } + mbgl::gl::ProcAddress initializeExtension(const char* name) override { + static CFBundleRef framework = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengl")); + if (!framework) { + throw std::runtime_error("Failed to load OpenGL framework."); + } + + CFStringRef str = CFStringCreateWithCString(kCFAllocatorDefault, name, kCFStringEncodingASCII); + void *symbol = CFBundleGetFunctionPointerForName(framework, str); + CFRelease(str); + + return reinterpret_cast<mbgl::gl::ProcAddress>(symbol); + } + void invalidate() override { [nativeView setNeedsGLDisplay]; } |