This commit is contained in:
twinaphex 2021-01-16 22:04:11 +01:00
parent 1d4ff9bedd
commit 225b851eb6
2 changed files with 23 additions and 14 deletions

View File

@ -50,6 +50,14 @@
#include "../common/metal_common.h" #include "../common/metal_common.h"
#endif #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 typedef struct cocoa_ctx_data
{ {
#ifdef HAVE_VULKAN #ifdef HAVE_VULKAN

View File

@ -20,8 +20,12 @@
#include <Foundation/Foundation.h> #include <Foundation/Foundation.h>
#if defined(HAVE_COCOATOUCH) #if defined(HAVE_COCOATOUCH)
#define GLContextClass EAGLContext #include <UIKit/UIKit.h>
#define GLFrameworkID CFSTR("com.apple.opengles")
#if TARGET_OS_TV
#import <GameController/GameController.h>
#endif
#define RAScreen UIScreen #define RAScreen UIScreen
#ifndef UIUserInterfaceIdiomTV #ifndef UIUserInterfaceIdiomTV
@ -32,25 +36,24 @@
#define UIUserInterfaceIdiomCarPlay 3 #define UIUserInterfaceIdiomCarPlay 3
#endif #endif
#else #else
#define GLContextClass NSOpenGLContext
#define GLFrameworkID CFSTR("com.apple.opengl")
#define RAScreen NSScreen #define RAScreen NSScreen
#endif #endif
typedef enum apple_view_type { #if TARGET_OS_OSX
APPLE_VIEW_TYPE_NONE, #include <AppKit/AppKit.h>
#endif
typedef enum apple_view_type
{
APPLE_VIEW_TYPE_NONE = 0,
APPLE_VIEW_TYPE_OPENGL_ES, APPLE_VIEW_TYPE_OPENGL_ES,
APPLE_VIEW_TYPE_OPENGL, APPLE_VIEW_TYPE_OPENGL,
APPLE_VIEW_TYPE_VULKAN, APPLE_VIEW_TYPE_VULKAN,
APPLE_VIEW_TYPE_METAL, APPLE_VIEW_TYPE_METAL
} apple_view_type_t; } apple_view_type_t;
#if defined(HAVE_COCOATOUCH) #if defined(HAVE_COCOATOUCH)
#include <UIKit/UIKit.h>
#if TARGET_OS_TV
#import <GameController/GameController.h>
#endif
#if TARGET_OS_IOS #if TARGET_OS_IOS
@interface CocoaView : UIViewController @interface CocoaView : UIViewController
@ -73,8 +76,6 @@ typedef struct
extern apple_frontend_settings_t apple_frontend_settings; extern apple_frontend_settings_t apple_frontend_settings;
#if TARGET_OS_OSX #if TARGET_OS_OSX
#include <AppKit/AppKit.h>
@interface CocoaView : NSView @interface CocoaView : NSView
+ (CocoaView*)get; + (CocoaView*)get;