From 7c31601ab48ca0ccf3f475193643ca5f652bd509 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Thu, 29 Sep 2022 13:55:02 -0700 Subject: [PATCH] swapchain API revision --- src/Refresh.cs | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/src/Refresh.cs b/src/Refresh.cs index ae93551..796ee56 100644 --- a/src/Refresh.cs +++ b/src/Refresh.cs @@ -371,13 +371,6 @@ namespace RefreshCS public uint level; } - [StructLayout(LayoutKind.Sequential)] - public struct PresentationParameters - { - public IntPtr deviceWindowHandle; - public PresentMode presentMode; - } - [StructLayout(LayoutKind.Sequential)] public struct SamplerStateCreateInfo { @@ -601,7 +594,6 @@ namespace RefreshCS [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr Refresh_CreateDevice( - in PresentationParameters presentationParameters, byte debugMode ); @@ -954,6 +946,32 @@ namespace RefreshCS /* Submission/Presentation */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern byte Refresh_ClaimWindow( + IntPtr device, + IntPtr windowHandle, + PresentMode presentMode + ); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern void Refresh_UnclaimWindow( + IntPtr device, + IntPtr windowHandle + ); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern void Refresh_SetSwapchainPresentMode( + IntPtr device, + IntPtr windowHandle, + PresentMode presentMode + ); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern TextureFormat Refresh_GetSwapchainFormat( + IntPtr device, + IntPtr windowHandle + ); + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr Refresh_AcquireCommandBuffer( IntPtr device, @@ -969,12 +987,6 @@ namespace RefreshCS out uint height ); - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern TextureFormat Refresh_GetSwapchainFormat( - IntPtr device, - IntPtr windowHandle - ); - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void Refresh_Submit( IntPtr device,