From 5344b449702efc1f767bdeee7b1d5b5fdccd0464 Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Mon, 12 Oct 2020 16:38:47 -0600 Subject: [PATCH] Make context_agl.h compatible with ObjC ARC code. Helpful when working with OpenEmu. --- src/common/gl/context_agl.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/gl/context_agl.h b/src/common/gl/context_agl.h index f5a9df280..25d69fe66 100644 --- a/src/common/gl/context_agl.h +++ b/src/common/gl/context_agl.h @@ -8,6 +8,7 @@ struct NSOpenGLContext; struct NSOpenGLPixelFormat; struct NSView; +#define __bridge #endif namespace GL { @@ -31,7 +32,7 @@ public: std::unique_ptr CreateSharedContext(const WindowInfo& wi) override; private: - ALWAYS_INLINE NSView* GetView() const { return static_cast(m_wi.window_handle); } + ALWAYS_INLINE NSView* GetView() const { return static_cast((__bridge NSView*)m_wi.window_handle); } bool Initialize(const Version* versions_to_try, size_t num_versions_to_try); bool CreateContext(NSOpenGLContext* share_context, int profile, bool make_current); @@ -45,4 +46,4 @@ private: void* m_opengl_module_handle = nullptr; }; -} // namespace GL \ No newline at end of file +} // namespace GL