diff --git a/apple/RetroArch/RAGameView.m b/apple/RetroArch/RAGameView.m index 4f87f560f1..bb4915f784 100644 --- a/apple/RetroArch/RAGameView.m +++ b/apple/RetroArch/RAGameView.m @@ -273,6 +273,20 @@ void apple_get_game_view_size(unsigned *width, unsigned *height) *height = *height ? *height : 480; } +void *apple_get_proc_address(const char *symbol_name) +{ +#ifdef IOS + (void)symbol_name; // We don't need symbols above GLES2 on iOS. + return NULL; +#else + CFStringRef symbol = CFStringCreateWithCString(kCFAllocatorDefault, symbol_name, kCFStringEncodingASCII); + void *proc = CFBundleGetFunctionPointerForName(CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengl")), + symbol); + CFRelease(symbol); + return proc; +#endif +} + #ifdef IOS void apple_bind_game_view_fbo(void) { diff --git a/apple/RetroArch/RetroArch_Apple.h b/apple/RetroArch/RetroArch_Apple.h index 27c9d27f0c..5302d3a4c2 100644 --- a/apple/RetroArch/RetroArch_Apple.h +++ b/apple/RetroArch/RetroArch_Apple.h @@ -18,6 +18,7 @@ #define __RARCH_APPLE_H #include +#import #import "RAModuleInfo.h" void apple_run_core(RAModuleInfo* core, const char* file); diff --git a/apple/RetroArch/rarch_wrapper.h b/apple/RetroArch/rarch_wrapper.h index 77a6521962..b92cf5eb83 100644 --- a/apple/RetroArch/rarch_wrapper.h +++ b/apple/RetroArch/rarch_wrapper.h @@ -29,6 +29,7 @@ void apple_destroy_game_view(void); void apple_flip_game_view(void); void apple_set_game_view_sync(unsigned interval); void apple_get_game_view_size(unsigned *width, unsigned *height); +void *apple_get_proc_address(const char *symbol_name); #ifdef IOS void apple_bind_game_view_fbo(void); diff --git a/gfx/context/apple_gl_ctx.c b/gfx/context/apple_gl_ctx.c index 78f48f3208..3fc50861b2 100644 --- a/gfx/context/apple_gl_ctx.c +++ b/gfx/context/apple_gl_ctx.c @@ -93,6 +93,11 @@ static void gfx_ctx_input_driver(const input_driver_t **input, void **input_data *input_data = NULL; } +static gfx_ctx_proc_t gfx_ctx_get_proc_address(const char *symbol_name) +{ + return (gfx_ctx_proc_t)apple_get_proc_address(symbol_name); +} + // The apple_* functions are implemented in apple/RetroArch/RAGameView.m const gfx_ctx_driver_t gfx_ctx_apple = { @@ -109,7 +114,7 @@ const gfx_ctx_driver_t gfx_ctx_apple = { gfx_ctx_has_focus, apple_flip_game_view, gfx_ctx_input_driver, - NULL, + gfx_ctx_get_proc_address, NULL, "ios", };