summaryrefslogtreecommitdiff
path: root/tools/gfx/apple
diff options
context:
space:
mode:
authorSimon Kallweit <simon.kallweit@gmail.com>2024-05-27 06:03:13 -0700
committerGitHub <noreply@github.com>2024-05-27 15:03:13 +0200
commitd9443d670ef8413971fe7c3f02368b60a7fc5904 (patch)
tree001e763846b23814b0e4960991fc457d7b580a0f /tools/gfx/apple
parent4f1cbf6f4d561320b8e3c73b871cc95dd13c6207 (diff)
[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 <skallweit@nvidia.com> Co-authored-by: Jay Kwak <82421531+jkwak-work@users.noreply.github.com>
Diffstat (limited to 'tools/gfx/apple')
-rw-r--r--tools/gfx/apple/cocoa-util.h2
-rw-r--r--tools/gfx/apple/cocoa-util.mm10
2 files changed, 10 insertions, 2 deletions
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
+
+
+}