diff --git a/Src/CommandBuffer.cs b/Src/CommandBuffer.cs index e054eb7..417856a 100644 --- a/Src/CommandBuffer.cs +++ b/Src/CommandBuffer.cs @@ -1963,6 +1963,18 @@ public ClearColorValue(ColorU4 value) : this() { UInt4 = value; } + + /// + /// Initializes a new instance of the structure. + /// + /// The red clear value. + /// The green clear value. + /// The blue clear value. + /// The alpha clear value. + public ClearColorValue(float r, float g, float b, float a = 1.0f) : this() + { + Float4 = new ColorF4(r, g, b, a); + } } /// diff --git a/Src/CommandPool.cs b/Src/CommandPool.cs index b21bbdf..3aa8d56 100644 --- a/Src/CommandPool.cs +++ b/Src/CommandPool.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Runtime.InteropServices; namespace VulkanCore diff --git a/Src/Ext/DebugReportCallbackExt.cs b/Src/Ext/DebugReportCallbackExt.cs index e9a43cc..3a4b8ee 100644 --- a/Src/Ext/DebugReportCallbackExt.cs +++ b/Src/Ext/DebugReportCallbackExt.cs @@ -35,7 +35,7 @@ internal DebugReportCallbackExt(Instance parent, }); callbackHandle = Interop.GetFunctionPointerForDelegate(_callback); } - createInfo.ToNative(out DebugReportCallbackCreateInfoExt.Native nativeCreateInfo, callbackHandle); + createInfo.ToNative(out DebugReportCallbackCreateInfoExt.Native nativeCreateInfo, callbackHandle); long handle; Result result = vkCreateDebugReportCallbackEXT(Parent)(Parent, &nativeCreateInfo, NativeAllocator, &handle); diff --git a/Src/Instance.cs b/Src/Instance.cs index 535121d..d295ecd 100644 --- a/Src/Instance.cs +++ b/Src/Instance.cs @@ -307,7 +307,7 @@ public unsafe struct ApplicationInfo /// The unsigned integer variable containing the developer-supplied version /// number of the application. /// - public int ApplicationVersion; + public Version ApplicationVersion; /// /// The unicode string containing the name of the engine (if any) used to create the application. /// @@ -316,7 +316,7 @@ public unsafe struct ApplicationInfo /// The unsigned integer variable containing the developer-supplied version /// number of the engine used to create the application. /// - public int EngineVersion; + public Version EngineVersion; /// /// The version of the Vulkan API against which the application expects to run. If is the implementation must ignore it, @@ -350,8 +350,8 @@ public unsafe struct ApplicationInfo /// the major and minor versions of the instance must match those requested in . /// public ApplicationInfo( - string applicationName = null, int applicationVersion = 0, - string engineName = null, int engineVersion = 0, + string applicationName = null, Version applicationVersion = default(Version), + string engineName = null, Version engineVersion = default(Version), Version apiVersion = default(Version)) { ApplicationName = applicationName; @@ -370,7 +370,7 @@ internal struct Native public int ApplicationVersion; public IntPtr EngineName; public int EngineVersion; - public Version ApiVersion; + public int ApiVersion; public void Free() { diff --git a/Src/Version.cs b/Src/Version.cs index baa70ab..64c998e 100644 --- a/Src/Version.cs +++ b/Src/Version.cs @@ -62,5 +62,10 @@ public Version(int major, int minor, int patch) /// A shorthand for writing new Version(0, 0, 0). /// public static Version Zero => new Version(0, 0, 0); + + public static implicit operator int(Version version) + { + return version._value; + } } } diff --git a/Src/VulkanLibrary.cs b/Src/VulkanLibrary.cs index 95b5961..d1a39c7 100644 --- a/Src/VulkanLibrary.cs +++ b/Src/VulkanLibrary.cs @@ -5,7 +5,10 @@ namespace VulkanCore { - internal static class VulkanLibrary + /// + /// Static vulkan library loaded from host platform. + /// + public static class VulkanLibrary { private static readonly IntPtr _handle; diff --git a/Tests/InstanceTest.cs b/Tests/InstanceTest.cs index c6ff85a..bf1d7fc 100644 --- a/Tests/InstanceTest.cs +++ b/Tests/InstanceTest.cs @@ -25,7 +25,7 @@ public void Constructor() public void ConstructorWithApplicationInfo() { var createInfo1 = new InstanceCreateInfo(new ApplicationInfo()); - var createInfo2 = new InstanceCreateInfo(new ApplicationInfo("app name", 1, "engine name", 2)); + var createInfo2 = new InstanceCreateInfo(new ApplicationInfo("app name", new Version(1, 0, 0), "engine name", new Version(2, 0, 0))); using (new Instance(createInfo1)) { } using (new Instance(createInfo2)) { } }