diff --git a/gfx/drivers_context/cocoa_gl_ctx.m b/gfx/drivers_context/cocoa_gl_ctx.m index 67a352b673..5a0291fa40 100644 --- a/gfx/drivers_context/cocoa_gl_ctx.m +++ b/gfx/drivers_context/cocoa_gl_ctx.m @@ -90,7 +90,7 @@ static NSOpenGLPixelFormat* g_format; static unsigned g_minor = 0; static unsigned g_major = 0; -GLContextClass *glcontext_get_ptr(void) +void *glcontext_get_ptr(void) { return g_context; } diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index c20767c17e..d920d4518f 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -37,7 +37,9 @@ static id apple_platform; /* forward declaration */ -GLContextClass *glcontext_get_ptr(void); +#ifdef HAVE_OPENGL +void *glcontext_get_ptr(void); +#endif void apple_rarch_exited(void) { @@ -350,7 +352,9 @@ static void open_document_handler(NSOpenPanel *panel, NSInteger result) } - (IBAction)openCore:(id)sender { - GLContextClass *glc = glcontext_get_ptr(); +#ifdef HAVE_OPENGL + GLContextClass *glc = (NSOpenGLContext*)glcontext_get_ptr(); +#endif NSOpenPanel* panel = (NSOpenPanel*)[NSOpenPanel openPanel]; settings_t *settings = config_get_ptr(); NSString *startdir = BOXSTRING(settings->libretro_directory); @@ -376,12 +380,16 @@ static void open_document_handler(NSOpenPanel *panel, NSInteger result) if (result == 1) open_core_handler(panel, result); #endif +#ifdef HAVE_OPENGL [glc makeCurrentContext]; +#endif } - (void)openDocument:(id)sender { - GLContextClass *glc = glcontext_get_ptr(); +#ifdef HAVE_OPENGL + GLContextClass *glc = (NSOpenGLContext*)glcontext_get_ptr(); +#endif NSOpenPanel* panel = (NSOpenPanel*)[NSOpenPanel openPanel]; settings_t *settings = config_get_ptr(); NSString *startdir = BOXSTRING(settings->menu_content_directory); @@ -408,7 +416,9 @@ static void open_document_handler(NSOpenPanel *panel, NSInteger result) if (result == 1) open_document_handler(panel, result); #endif +#ifdef HAVE_OPENGL [glc makeCurrentContext]; +#endif } - (void)unloadingCore