summaryrefslogtreecommitdiff
path: root/include/yasl/metal.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/yasl/metal.h')
-rw-r--r--include/yasl/metal.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/yasl/metal.h b/include/yasl/metal.h
new file mode 100644
index 0000000..695f80c
--- /dev/null
+++ b/include/yasl/metal.h
@@ -0,0 +1,20 @@
+/** @file Direct Metal layer; application configures its device/format and presents. */
+#ifndef YASL_METAL_H
+#define YASL_METAL_H
+#include "yasl/yasl.h"
+#ifdef __OBJC__
+@class CAMetalLayer;
+#else
+typedef struct objc_object CAMetalLayer;
+#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+/** Borrowed until surface destruction. YASL owns view/layer and drawableSize.
+ * No device, drawable acquisition, command submission, or implicit present.
+ * Returns NULL on unsupported backend, CPU/GL surface, or incompatible presenter. */
+YASL_API CAMetalLayer *yasl_metal_layer(yasl_surface *surface);
+#ifdef __cplusplus
+}
+#endif
+#endif