From c73b5bdf4604be24a6ae78c4aa5b5ae94ec0e6fa Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Thu, 26 Dec 2024 23:58:55 -0600 Subject: [PATCH] metal: wip: allow getting/setting developerHUDProperies --- .../CAMetalLayerExtensions.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Ryujinx.Graphics.Metal.SharpMetalExtensions/CAMetalLayerExtensions.cs b/src/Ryujinx.Graphics.Metal.SharpMetalExtensions/CAMetalLayerExtensions.cs index 361419658..91e94fb2c 100644 --- a/src/Ryujinx.Graphics.Metal.SharpMetalExtensions/CAMetalLayerExtensions.cs +++ b/src/Ryujinx.Graphics.Metal.SharpMetalExtensions/CAMetalLayerExtensions.cs @@ -6,16 +6,25 @@ using System.Runtime.Versioning; namespace Ryujinx.Graphics.Metal.SharpMetalExtensions { - [SupportedOSPlatform("OSX")] + [SupportedOSPlatform("macOS")] public static class CAMetalLayerExtensions { private static readonly Selector sel_displaySyncEnabled = "displaySyncEnabled"; private static readonly Selector sel_setDisplaySyncEnabled = "setDisplaySyncEnabled:"; + private static readonly Selector sel_developerHUDProperties = "developerHUDProperties"; + private static readonly Selector sel_setDeveloperHUDProperties = "setDeveloperHUDProperties:"; + public static bool IsDisplaySyncEnabled(this CAMetalLayer metalLayer) => ObjectiveCRuntime.bool_objc_msgSend(metalLayer.NativePtr, sel_displaySyncEnabled); public static void SetDisplaySyncEnabled(this CAMetalLayer metalLayer, bool enabled) => ObjectiveCRuntime.objc_msgSend(metalLayer.NativePtr, sel_setDisplaySyncEnabled, enabled); + + public static nint GetDeveloperHudProperties(this CAMetalLayer metalLayer) + => ObjectiveCRuntime.IntPtr_objc_msgSend(metalLayer.NativePtr, sel_developerHUDProperties); + + public static void SetDeveloperHudProperties(this CAMetalLayer metalLayer, nint dictionaryPointer) + => ObjectiveCRuntime.objc_msgSend(metalLayer.NativePtr, sel_setDisplaySyncEnabled, dictionaryPointer); } }