Revert "(Cocoa) Move nsview_get_ptr and nsview_set_ptr to cocoa_gl_ctx.m"

This reverts commit 4f564360e7ba3df82e496d8dec8ca1a0dc3d4261.
This commit is contained in:
Twinaphex 2019-09-22 10:54:01 +02:00
parent 4f564360e7
commit 83f1b28f98
3 changed files with 25 additions and 26 deletions

View File

@ -93,27 +93,8 @@ static unsigned g_major = 0;
@end
#endif
static CocoaView* g_instance;
void *nsview_set_ptr(void *inst)
{
g_instance = (BRIDGE void*)inst;
return (BRIDGE void *)g_instance;
}
void *nsview_get_ptr(void)
{
#if defined(HAVE_COCOA)
video_driver_display_type_set(RARCH_DISPLAY_OSX);
video_driver_display_set(0);
video_driver_display_userdata_set((uintptr_t)g_instance);
#elif defined(HAVE_COCOA_METAL)
video_driver_display_type_set(RARCH_DISPLAY_OSX);
video_driver_display_set(0);
video_driver_display_userdata_set((uintptr_t)g_instance);
#endif
return (BRIDGE void *)g_instance;
}
/* forward declaration */
void *nsview_get_ptr(void);
#if defined(HAVE_COCOA) || defined(HAVE_COCOA_METAL)
static NSOpenGLPixelFormat* g_format;
@ -186,7 +167,7 @@ void *glkitview_init(void)
return (BRIDGE void *)((GLKView*)g_view);
#else
return nsview_get_ptr();
return nsview_get_ptr();
#endif
}

View File

@ -144,8 +144,4 @@ extern apple_frontend_settings_t apple_frontend_settings;
void *get_chosen_screen(void);
void *nsview_set_ptr(void *inst);
void *nsview_get_ptr(void);
#endif

View File

@ -31,6 +31,28 @@
#import "WebServer.h"
#endif
static CocoaView* g_instance;
void *nsview_set_ptr(void *inst)
{
g_instance = (BRIDGE void*)inst;
return (BRIDGE void *)g_instance;
}
void *nsview_get_ptr(void)
{
#if defined(HAVE_COCOA)
video_driver_display_type_set(RARCH_DISPLAY_OSX);
video_driver_display_set(0);
video_driver_display_userdata_set((uintptr_t)g_instance);
#elif defined(HAVE_COCOA_METAL)
video_driver_display_type_set(RARCH_DISPLAY_OSX);
video_driver_display_set(0);
video_driver_display_userdata_set((uintptr_t)g_instance);
#endif
return (BRIDGE void *)g_instance;
}
/* forward declarations */
void cocoagl_gfx_ctx_update(void);
void *glkitview_init(void);