(Cocoa) See if this works

This commit is contained in:
twinaphex 2019-09-22 10:43:31 +02:00
parent 23bb1414ff
commit 1ddd7ee79d

View File

@ -33,6 +33,12 @@
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)
@ -75,20 +81,11 @@ void *glkitview_init(void);
+ (CocoaView*)get
{
if (!g_instance)
g_instance = [CocoaView new];
void *inst = nsview_get_ptr();
if (!inst)
return nsview_set_ptr([CocoaView new]);
#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 g_instance;
return inst;
}
- (id)init