support the OpenGL driver in the metal build by delegating the view initialization to the ApplePlatform delegate (metal build only for now)

This commit is contained in:
Yoshi Sugawara 2020-07-20 14:00:28 -10:00
parent b1a718d8c5
commit 271ac7f925
3 changed files with 7 additions and 3 deletions

View File

@ -831,6 +831,10 @@ static void *cocoagl_gfx_ctx_init(void *video_driver)
{
#if defined(HAVE_COCOATOUCH)
case GFX_CTX_OPENGL_ES_API:
#if defined(HAVE_COCOA_METAL)
// the metal build supports both the OpenGL and Metal video drivers
[apple_platform setViewType:APPLE_VIEW_TYPE_OPENGL_ES];
#endif
// setViewType is not (yet?) defined for iOS
// [apple_platform setViewType:APPLE_VIEW_TYPE_OPENGL_ES];
break;

View File

@ -1005,7 +1005,7 @@ static const ui_companion_driver_t *ui_companion_drivers[] = {
#if defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__)
&ui_companion_win32,
#endif
#if !defined(HAVE_COCOATOUCH) && (defined(HAVE_COCOA) || defined(HAVE_COCOA_METAL))
#if TARGET_OS_OSX
&ui_companion_cocoa,
#endif
#ifdef HAVE_COCOATOUCH

View File

@ -352,9 +352,9 @@ enum
}
break;
case APPLE_VIEW_TYPE_OPENGL:
case APPLE_VIEW_TYPE_OPENGL_ES:
{
_renderView = [CocoaView get];
_renderView = (BRIDGE GLKView*)glkitview_init();
break;
}