mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 04:14:00 +00:00
Move nsview_set/get/cocoaview_get to cocoa_common.m
This commit is contained in:
parent
eea07ea367
commit
3d17cf1e38
@ -85,7 +85,6 @@ static unsigned g_major = 0;
|
||||
#ifdef OSX
|
||||
static NSOpenGLPixelFormat* g_format;
|
||||
#endif
|
||||
static CocoaView* g_instance;
|
||||
#if defined(HAVE_COCOATOUCH)
|
||||
static GLKView *glk_view = NULL;
|
||||
|
||||
@ -106,30 +105,6 @@ static GLKView *glk_view = NULL;
|
||||
@end
|
||||
#endif
|
||||
|
||||
void *nsview_get_ptr(void)
|
||||
{
|
||||
#if defined(OSX)
|
||||
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;
|
||||
}
|
||||
|
||||
void nsview_set_ptr(CocoaView *p) { g_instance = p; }
|
||||
|
||||
CocoaView *cocoaview_get(void)
|
||||
{
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
return (CocoaView*)apple_platform.renderView;
|
||||
#elif defined(HAVE_COCOA)
|
||||
return g_instance;
|
||||
#else
|
||||
/* TODO/FIXME - implement */
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
static uint32_t cocoa_gl_gfx_ctx_get_flags(void *data)
|
||||
{
|
||||
uint32_t flags = 0;
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include "apple_platform.h"
|
||||
#endif
|
||||
|
||||
static CocoaView* g_instance;
|
||||
|
||||
/* forward declarations */
|
||||
void cocoa_gl_gfx_ctx_update(void);
|
||||
|
||||
@ -411,3 +413,27 @@ float cocoa_screen_get_native_scale(void)
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
void *nsview_get_ptr(void)
|
||||
{
|
||||
#if defined(OSX)
|
||||
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;
|
||||
}
|
||||
|
||||
void nsview_set_ptr(CocoaView *p) { g_instance = p; }
|
||||
|
||||
CocoaView *cocoaview_get(void)
|
||||
{
|
||||
#if defined(HAVE_COCOA_METAL)
|
||||
return (CocoaView*)apple_platform.renderView;
|
||||
#elif defined(HAVE_COCOA)
|
||||
return g_instance;
|
||||
#else
|
||||
/* TODO/FIXME - implement */
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user