From e67269e41ef883922c28cf2329e5efaca729ae82 Mon Sep 17 00:00:00 2001 From: scawful Date: Fri, 2 Aug 2024 15:36:02 -0400 Subject: [PATCH] add iOS AppViewController interface for MTKViewDelegate/NSWindowDelegate --- src/app/core/platform/app_view_controller.h | 25 +++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/app/core/platform/app_view_controller.h diff --git a/src/app/core/platform/app_view_controller.h b/src/app/core/platform/app_view_controller.h new file mode 100644 index 00000000..a12e1cb4 --- /dev/null +++ b/src/app/core/platform/app_view_controller.h @@ -0,0 +1,25 @@ +#ifndef YAZE_APP_CORE_PLATFORM_APP_VIEW_CONTROLLER_H +#define YAZE_APP_CORE_PLATFORM_APP_VIEW_CONTROLLER_H + +#ifdef __APPLE__ +#include + +#if TARGET_OS_OSX +#include "imgui_impl_osx.h" +@interface AppViewController : NSViewController +@end +#else +@interface AppViewController : UIViewController +@property(nonatomic) yaze::app::core::Controller *controller; +@end +#endif + +@interface AppViewController () +@property(nonatomic, readonly) MTKView *mtkView; +@property(nonatomic, strong) id device; +@property(nonatomic, strong) id commandQueue; +@end + +#endif // __APPLE__ + +#endif // YAZE_APP_CORE_PLATFORM_APP_VIEW_CONTROLLER_H