#import #import #import #import "MetalConfig.h" #if TARGET_OS_IOS || TARGET_OS_TV #import #define PlatformView UIView #else #import #define PlatformView NSView #endif // The protocol to provide resize and redraw callbacks to a delegate. @protocol MetalViewDelegate - (void)drawableResize:(CGSize)size; - (void)renderTo:(nonnull CAMetalLayer *)layer; - (void)waitToRenderTo:(nonnull CAMetalLayer *)layer; @end // The Metal game view base class. @interface MetalView : PlatformView @property (nonatomic, nonnull, readonly) CAMetalLayer *metalLayer; @property (nonatomic, getter=isPaused) BOOL paused; @property (nonatomic, nullable) id delegate; @property (nonatomic) float framerate; - (void)initCommon; #if AUTOMATICALLY_RESIZE - (void)resizeDrawable:(CGFloat)scaleFactor; #endif @end