From 2bfadbdad50c1658331af3c4af6bd89f15afa6a2 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Mon, 14 Sep 2020 16:15:53 +0200 Subject: [PATCH] (Apple CocoaGL) Call flushBuffer with msg_objcSend --- gfx/drivers_context/cocoa_gl_ctx.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gfx/drivers_context/cocoa_gl_ctx.m b/gfx/drivers_context/cocoa_gl_ctx.m index 572e0de64c..f469763aa1 100644 --- a/gfx/drivers_context/cocoa_gl_ctx.m +++ b/gfx/drivers_context/cocoa_gl_ctx.m @@ -114,6 +114,7 @@ void nsview_set_ptr(CocoaView *p) } #if TARGET_OS_OSX +static SEL sel_flushBuffer; static NSOpenGLPixelFormat* g_format; void *glcontext_get_ptr(void) @@ -632,8 +633,8 @@ static void cocoagl_gfx_ctx_swap_buffers(void *data) return; #if TARGET_OS_OSX - [g_context flushBuffer]; - [g_hw_ctx flushBuffer]; + ((id (*)(id, SEL))objc_msgSend)(g_context, sel_flushBuffer); + ((id (*)(id, SEL))objc_msgSend)(g_hw_ctx, sel_flushBuffer); #elif defined(HAVE_COCOATOUCH) if (g_view) [g_view display]; @@ -868,6 +869,9 @@ static void *cocoagl_gfx_ctx_init(void *video_driver) default: break; } + + if (!sel_flushBuffer) + sel_flushBuffer = sel_registerName("flushBuffer"); return cocoa_ctx; }