diff --git a/gfx/drivers_context/cocoa_gl_ctx.m b/gfx/drivers_context/cocoa_gl_ctx.m index 8f03130b33..5e1f3d9e02 100644 --- a/gfx/drivers_context/cocoa_gl_ctx.m +++ b/gfx/drivers_context/cocoa_gl_ctx.m @@ -50,6 +50,14 @@ #include "../common/metal_common.h" #endif +#if defined(HAVE_COCOATOUCH) +#define GLContextClass EAGLContext +#define GLFrameworkID CFSTR("com.apple.opengles") +#else +#define GLContextClass NSOpenGLContext +#define GLFrameworkID CFSTR("com.apple.opengl") +#endif + typedef struct cocoa_ctx_data { #ifdef HAVE_VULKAN diff --git a/ui/drivers/cocoa/cocoa_common.h b/ui/drivers/cocoa/cocoa_common.h index 0789fe17d8..2b860e910d 100644 --- a/ui/drivers/cocoa/cocoa_common.h +++ b/ui/drivers/cocoa/cocoa_common.h @@ -20,8 +20,12 @@ #include #if defined(HAVE_COCOATOUCH) -#define GLContextClass EAGLContext -#define GLFrameworkID CFSTR("com.apple.opengles") +#include + +#if TARGET_OS_TV +#import +#endif + #define RAScreen UIScreen #ifndef UIUserInterfaceIdiomTV @@ -32,25 +36,24 @@ #define UIUserInterfaceIdiomCarPlay 3 #endif #else -#define GLContextClass NSOpenGLContext -#define GLFrameworkID CFSTR("com.apple.opengl") + #define RAScreen NSScreen #endif -typedef enum apple_view_type { - APPLE_VIEW_TYPE_NONE, +#if TARGET_OS_OSX +#include +#endif + +typedef enum apple_view_type +{ + APPLE_VIEW_TYPE_NONE = 0, APPLE_VIEW_TYPE_OPENGL_ES, APPLE_VIEW_TYPE_OPENGL, APPLE_VIEW_TYPE_VULKAN, - APPLE_VIEW_TYPE_METAL, + APPLE_VIEW_TYPE_METAL } apple_view_type_t; #if defined(HAVE_COCOATOUCH) -#include - -#if TARGET_OS_TV -#import -#endif #if TARGET_OS_IOS @interface CocoaView : UIViewController @@ -73,8 +76,6 @@ typedef struct extern apple_frontend_settings_t apple_frontend_settings; #if TARGET_OS_OSX -#include - @interface CocoaView : NSView + (CocoaView*)get;