From: Jean-Philippe Bruyère Date: Sun, 5 May 2019 20:56:14 +0000 (+0200) Subject: Merge branch 'temp' of https://github.com/jpbruyere/Crow into vknet X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=5f34744c797be5031b697fab73eff6e8d8b6f8b5;p=jp%2Fcrow.git Merge branch 'temp' of https://github.com/jpbruyere/Crow into vknet --- 5f34744c797be5031b697fab73eff6e8d8b6f8b5 diff --cc Samples/HelloWorld/HelloWorld.csproj index 64976e45,e9074cfc..cda10df5 --- a/Samples/HelloWorld/HelloWorld.csproj +++ b/Samples/HelloWorld/HelloWorld.csproj @@@ -28,6 -29,6 +29,6 @@@ - + -- ++ diff --cc Samples/HelloWorld/main.cs index 32552200,1590f28b..9465f713 --- a/Samples/HelloWorld/main.cs +++ b/Samples/HelloWorld/main.cs @@@ -13,4 -11,4 +11,4 @@@ namespace HelloWorl } } --} ++} diff --cc Samples/ShowCase/ShowCase.csproj index b0f5b200,032f1779..e557be1a --- a/Samples/ShowCase/ShowCase.csproj +++ b/Samples/ShowCase/ShowCase.csproj @@@ -1,70 -1,47 +1,45 @@@ -  - - ++ + - Exe - v4.7.1 - $(SolutionDir)build\$(Configuration)\samples\ - 8.0.30703 - 2.0 - {56329D48-D382-4850-93DE-59C453894E8A} + net472 + $(SolutionDir)build\$(Configuration)\ + Exe + https://github.com/jpbruyere/Crow + https://opensource.org/licenses/MIT + true + false + net472 0.8.0 + - true full - false - DEBUG - prompt - 4 + TRACE;DEBUG + true - - true - 4 - - - + + + + + + + + + + + + + data\%(RecursiveDir)%(Filename)%(Extension) + ShowCase.%(Filename)%(Extension) - - + + PreserveNewest Interfaces\%(RecursiveDir)%(Filename)%(Extension) - - ShowCase.divers.%(Filename)%(Extension) - - - - - - ..\..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll - - - ..\..\packages\glTF2Loader.1.1.3-alpha\lib\net35\glTFLoader.dll - - - ..\..\packages\System.Numerics.Vectors.4.6.0-preview4.19212.13\lib\net46\System.Numerics.Vectors.dll - - - - - ..\..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0-preview4.19212.13\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll - - - ..\..\packages\Vulkan.0.1.2.6\lib\netstandard2.0\VK.dll - - - ..\..\packages\CVKL.0.1.2\lib\netstandard2.0\CVKL-dotnet.dll - - - - - {C2980F9B-4798-4C05-99E2-E174810F7C7B} - Crow - - + - + - - - diff --cc Samples/ShowCase/main.cs index b3437aeb,6bd63bb0..9c93758b --- a/Samples/ShowCase/main.cs +++ b/Samples/ShowCase/main.cs @@@ -1,9 -1,5 +1,5 @@@ - using System; -using System.IO; +using System.IO; - using System.Threading; using Crow; - using CVKL; - using VK; namespace HelloWorld { @@@ -138,128 -59,5 +59,5 @@@ { NotifyValueChanged ("ShowError", false); } - - void buildCommandBuffers () { - for (int i = 0; i < swapChain.ImageCount; ++i) { - cmds[i]?.Free (); - cmds[i] = cmdPool.AllocateAndStart (); - - CommandBuffer cmd = cmds [i]; - - swapChain.images [i].SetLayout (cmd, VkImageAspectFlags.Color, - VkImageLayout.Undefined, VkImageLayout.TransferDstOptimal, - VkPipelineStageFlags.BottomOfPipe, VkPipelineStageFlags.Transfer); - uiImage.SetLayout (cmd, VkImageAspectFlags.Color, - VkImageLayout.ColorAttachmentOptimal, VkImageLayout.TransferSrcOptimal, - VkPipelineStageFlags.ColorAttachmentOutput, VkPipelineStageFlags.Transfer); - - VkImageSubresourceLayers imgSubResLayer = new VkImageSubresourceLayers { - aspectMask = VkImageAspectFlags.Color, - mipLevel = 0, - baseArrayLayer = 0, - layerCount = 1 - }; - VkImageCopy cregion = new VkImageCopy { - srcSubresource = imgSubResLayer, - srcOffset = default (VkOffset3D), - dstSubresource = imgSubResLayer, - dstOffset = default (VkOffset3D), - extent = new VkExtent3D { width = swapChain.Width, height = swapChain.Height } - }; - Vk.vkCmdCopyImage (cmds [i].Handle, uiImage.Handle, VkImageLayout.TransferSrcOptimal, - swapChain.images [i].Handle, VkImageLayout.TransferDstOptimal, 1, ref cregion); - - swapChain.images [i].SetLayout (cmd, VkImageAspectFlags.Color, - VkImageLayout.TransferDstOptimal, VkImageLayout.PresentSrcKHR, - VkPipelineStageFlags.Transfer, VkPipelineStageFlags.BottomOfPipe); - uiImage.SetLayout (cmd, VkImageAspectFlags.Color, - VkImageLayout.TransferSrcOptimal, VkImageLayout.ColorAttachmentOptimal, - VkPipelineStageFlags.Transfer, VkPipelineStageFlags.ColorAttachmentOutput); - - cmds [i].End (); - } - } - - - #region update - int frameCount = 0; - - public override void Update () { - if (++frameCount > 20) { - NotifyValueChanged ("fps", fps); - frameCount = 0; - } - } - #endregion - - - protected override void OnResize () { - dev.WaitIdle (); - - crow.ProcessResize (new Crow.Rectangle (0, 0, (int)swapChain.Width, (int)swapChain.Height)); - - initUISurface (); - - buildCommandBuffers (); - dev.WaitIdle (); - } - #region Mouse and keyboard - //protected override void onScroll (double xOffset, double yOffset) - //{ - // if (KeyModifiers.HasFlag (Glfw.Modifier.Shift)) - // crow.ProcessMouseWheelChanged ((float)xOffset); - // else - // crow.ProcessMouseWheelChanged ((float)yOffset); - //} - protected override void onMouseMove (double xPos, double yPos) - { - if (crow.ProcessMouseMove ((int)xPos, (int)yPos)) - return; - } - protected override void onMouseButtonDown (Glfw.MouseButton button) - { - if (crow.ProcessMouseButtonDown ((Crow.MouseButton)button)) - return; - base.onMouseButtonDown (button); - } - protected override void onMouseButtonUp (Glfw.MouseButton button) - { - if (crow.ProcessMouseButtonUp ((Crow.MouseButton)button)) - return; - base.onMouseButtonUp (button); - } - protected override void onKeyDown (Glfw.Key key, int scanCode, Glfw.Modifier modifiers) - { - if (crow.ProcessKeyDown ((Crow.Key)key)) - return; - } - protected override void onKeyUp (Glfw.Key key, int scanCode, Glfw.Modifier modifiers) - { - if (crow.ProcessKeyUp ((Crow.Key)key)) - return; - } - //protected override void onChar (Glfw.CodePoint cp) - //{ - // if (crow.ProcessKeyPress (cp.ToChar ())) - // return; - //} - #endregion - - #region dispose - protected override void Dispose (bool disposing) { - if (disposing) { - if (!isDisposed) { - dev.WaitIdle (); - - isRunning = false; - uiImage?.Dispose (); - while (crow != null) - Thread.Sleep (1); - } - } - - base.Dispose (disposing); - } - #endregion } --} ++}