From d9443d670ef8413971fe7c3f02368b60a7fc5904 Mon Sep 17 00:00:00 2001 From: Simon Kallweit Date: Mon, 27 May 2024 06:03:13 -0700 Subject: [gfx] metal backend skeleton (#4223) * add metal-cpp submodule * add metal-cpp cmake target * gfx metal backend skeleton * add premake support * add foundation framework * add metal-cpp include to premake * update vs project file --------- Co-authored-by: Simon Kallweit Co-authored-by: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> --- tools/gfx/apple/cocoa-util.h | 2 +- tools/gfx/apple/cocoa-util.mm | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'tools/gfx/apple') diff --git a/tools/gfx/apple/cocoa-util.h b/tools/gfx/apple/cocoa-util.h index 565783ee9..e9d29b87c 100644 --- a/tools/gfx/apple/cocoa-util.h +++ b/tools/gfx/apple/cocoa-util.h @@ -9,7 +9,7 @@ struct CocoaUtil { static void* createMetalLayer(void* nswindow); static void destroyMetalLayer(void* metalLayer); - + static void* nextDrawable(void* metalLayer) ; }; } diff --git a/tools/gfx/apple/cocoa-util.mm b/tools/gfx/apple/cocoa-util.mm index 29c3056a9..5c12e587a 100644 --- a/tools/gfx/apple/cocoa-util.mm +++ b/tools/gfx/apple/cocoa-util.mm @@ -22,10 +22,18 @@ void* CocoaUtil::createMetalLayer(void* nswindow) return layer; } +void* CocoaUtil::nextDrawable(void* metalLayer) +{ + CAMetalLayer* layer = (CAMetalLayer*)metalLayer; + return [layer nextDrawable]; +} + void CocoaUtil::destroyMetalLayer(void* metalLayer) { CAMetalLayer* layer = (CAMetalLayer*)metalLayer; [layer release]; } -} \ No newline at end of file + + +} -- cgit v1.2.3