-sudo: required
-dist: trusty
language: csharp
-solution: Crow.sln
-before_install:
- - sudo apt-get -qq update
- - sudo apt-get install -y libcairo1.10-cil libgio3.0-cil libgdk3.0-cil libglib3.0-cil
-install:
- - nuget restore Crow.sln
-script:
- - xbuild /p:Configuration=Release Crow.sln
+dist: xenial
+
+dotnet: 2.1.502
+mono: latest
+script:
+ - nuget restore Crow.sln
+ - msbuild Crow.sln
+ - dotnet restore
+ - dotnet build Crow.sln
+
\ No newline at end of file
+++ /dev/null
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26124.0
-MinimumVisualStudioVersion = 15.0.26124.0
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crow.NetStd", "Crow\Crow.NetStd.csproj", "{75BDE4C7-4BAF-4A03-B697-5D1370775E20}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.NetStd", "Tests\Tests.NetStd.csproj", "{28BAF8B8-6A6E-40D5-8E9C-E7C1165C59DD}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrowIDE.NetStd", "CrowIDE\CrowIDE.NetStd.csproj", "{A01B3151-BC81-437C-B526-CC8DBB808638}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Debug|x64 = Debug|x64
- Debug|x86 = Debug|x86
- Release|Any CPU = Release|Any CPU
- Release|x64 = Release|x64
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {75BDE4C7-4BAF-4A03-B697-5D1370775E20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {75BDE4C7-4BAF-4A03-B697-5D1370775E20}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {75BDE4C7-4BAF-4A03-B697-5D1370775E20}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {75BDE4C7-4BAF-4A03-B697-5D1370775E20}.Release|Any CPU.Build.0 = Release|Any CPU
- {28BAF8B8-6A6E-40D5-8E9C-E7C1165C59DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {28BAF8B8-6A6E-40D5-8E9C-E7C1165C59DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {28BAF8B8-6A6E-40D5-8E9C-E7C1165C59DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {28BAF8B8-6A6E-40D5-8E9C-E7C1165C59DD}.Release|Any CPU.Build.0 = Release|Any CPU
- {A01B3151-BC81-437C-B526-CC8DBB808638}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A01B3151-BC81-437C-B526-CC8DBB808638}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A01B3151-BC81-437C-B526-CC8DBB808638}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A01B3151-BC81-437C-B526-CC8DBB808638}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
-EndGlobal
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crow", "Crow\Crow.csproj", "{C2980F9B-4798-4C05-99E2-E174810F7C7B}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrowIDE", "CrowIDE\CrowIDE.csproj", "{B6D911CD-1D09-42FC-B300-9187190F2AE1}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloWorld", "Samples\HelloWorld\HelloWorld.csproj", "{1F18E74F-BCC9-481C-8888-89D81CBB30BE}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShowCase", "Samples\ShowCase\ShowCase.csproj", "{56329D48-D382-4850-93DE-59C453894E8A}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Release|Any CPU.Build.0 = Release|Any CPU
{C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Any CPU.Build.0 = Release|Any CPU
- {1F18E74F-BCC9-481C-8888-89D81CBB30BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1F18E74F-BCC9-481C-8888-89D81CBB30BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1F18E74F-BCC9-481C-8888-89D81CBB30BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1F18E74F-BCC9-481C-8888-89D81CBB30BE}.Release|Any CPU.Build.0 = Release|Any CPU
- {56329D48-D382-4850-93DE-59C453894E8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {56329D48-D382-4850-93DE-59C453894E8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {56329D48-D382-4850-93DE-59C453894E8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {56329D48-D382-4850-93DE-59C453894E8A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0
version = 0.8.0
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
- {1F18E74F-BCC9-481C-8888-89D81CBB30BE} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
- {56329D48-D382-4850-93DE-59C453894E8A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
EndGlobalSection
EndGlobal
<ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">
<Reference Include="System" />
+ <Reference Include="mscorlib" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
+ <ItemGroup Condition="$(TargetFramework.StartsWith('netstandard'))">
+ <PackageReference Include="System.Reflection.Emit.ILGeneration" Version="4.3.0" />
+ <PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.3.0" />
+ </ItemGroup>
+
<ItemGroup>
<Compile Include="src\**\*.cs" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\..\vke\CVKL.csproj" />
- </ItemGroup>
-
+ <PackageReference Include="Vulkan" Version="0.1.2.8-beta" />
+ </ItemGroup>
</Project>
+++ /dev/null
-using System;
-using System.Threading;
-using Crow;
-using CVKL;
-using VK;
-
-namespace Crow
-{
- public class CrowVkWin : VkWindow, IValueChange {
- bool isRunning;
-
- protected override void render () {
- int idx = swapChain.GetNextImage ();
-
- if (idx < 0) {
- OnResize ();
- return;
- }
-
- lock (crow.RenderMutex) {
- presentQueue.Submit (cmds[idx], swapChain.presentComplete, drawComplete[idx]);
- presentQueue.Present (swapChain, drawComplete[idx]);
- presentQueue.WaitIdle ();
- }
- Thread.Sleep (1);
- }
-
- #region crow
- #region IValueChange implementation
- public event EventHandler<Crow.ValueChangeEventArgs> ValueChanged;
- public virtual void NotifyValueChanged (string MemberName, object _value)
- {
- if (ValueChanged != null)
- ValueChanged.Invoke (this, new Crow.ValueChangeEventArgs (MemberName, _value));
- }
- #endregion
-
- protected Crow.Interface crow;
-
- void crow_thread_func () {
- vkvgDev = new vkvg.Device (instance.Handle, phy.Handle, dev.VkDev.Handle, presentQueue.qFamIndex,
- vkvg.SampleCount.Sample_8, presentQueue.index);
-
- crow = new Crow.Interface (vkvgDev, 800, 600);
-
- isRunning = true;
- while (isRunning) {
- crow.Update ();
- Thread.Sleep (3);
- }
-
- crow.Dispose ();
- vkvgDev.Dispose ();
-
- crow = null;
- }
- #endregion
-
-
- protected CVKL.Image uiImage;
- protected vkvg.Device vkvgDev;
-
- void initUISurface () {
- lock (crow.UpdateMutex) {
- try {
- uiImage?.Dispose ();
- uiImage = new CVKL.Image (dev, new VkImage ((ulong)crow.surf.VkImage.ToInt64 ()), VkFormat.B8g8r8a8Unorm,
- VkImageUsageFlags.Sampled, swapChain.Width, swapChain.Height);
- uiImage.SetName ("uiImage");
- uiImage.CreateView (VkImageViewType.ImageView2D, VkImageAspectFlags.Color);
- uiImage.CreateSampler (VkFilter.Nearest, VkFilter.Nearest, VkSamplerMipmapMode.Nearest, VkSamplerAddressMode.ClampToBorder);
- uiImage.Descriptor.imageLayout = VkImageLayout.ShaderReadOnlyOptimal;
- } catch (Exception ex) {
- Console.WriteLine (ex);
- }
- }
- }
-
- protected CrowVkWin () : base() {
- Thread crowThread = new Thread (crow_thread_func);
- crowThread.IsBackground = true;
- crowThread.Start ();
-
- while (crow == null)
- Thread.Sleep (2);
-
- initUISurface ();
- }
-
- protected virtual void recordDraw (CommandBuffer cmd, int imageIndex) { }
-
- void buildCommandBuffers () {
- for (int i = 0; i < swapChain.ImageCount; ++i) {
- cmds[i]?.Free ();
- cmds[i] = cmdPool.AllocateAndStart ();
-
- CommandBuffer cmd = cmds [i];
-
- recordDraw (cmd, 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 ();
- }
- }
-
- /// <summary>
- /// rebuild command buffers if needed
- /// </summary>
- public override void Update () {
- if (rebuildBuffers) {
- buildCommandBuffers ();
- rebuildBuffers = false;
- }
- }
-
- 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
- }
-}
\ No newline at end of file
+++ /dev/null
-//
-// AssemblyInfo.cs
-//
-// Author:
-// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-// Information about this assembly is defined by the following attributes.
-// Change them to the values specific to your project.
-
-[assembly: AssemblyTitle ("Crow")]
-[assembly: AssemblyDescription ("C# Rapid Open Widgets")]
-[assembly: AssemblyConfiguration ("")]
-[assembly: AssemblyCompany ("Grand Tetra Software")]
-[assembly: AssemblyProduct ("Crow")]
-[assembly: AssemblyCopyright ("Copyright (c) 2018 - Jean-Philippe Bruyère <jp_bruyere@hotmail.com>")]
-[assembly: AssemblyTrademark ("")]
-[assembly: AssemblyCulture ("")]
-
-// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
-// The form "{Major}.{Minor}.*" will automatically update the build and revision,
-// and "{Major}.{Minor}.{Build}.*" will update just the revision.
-
-[assembly: AssemblyVersion ("0.7.1")]
-
-// The following attributes are used to specify the signing key for the assembly,
-// if desired. See the Mono documentation for more information about signing.
-
-//[assembly: AssemblyDelaySign(false)]
-//[assembly: AssemblyKeyFile("crow.key")]
-
--- /dev/null
+using System;
+using System.Threading;
+using Crow;
+using CVKL;
+using VK;
+
+namespace Crow
+{
+ public class CrowVkWin : VkWindow, IValueChange {
+ #region IValueChange implementation
+ public event EventHandler<Crow.ValueChangeEventArgs> ValueChanged;
+ public virtual void NotifyValueChanged(string MemberName, object _value)
+ {
+ if (ValueChanged != null)
+ ValueChanged.Invoke(this, new Crow.ValueChangeEventArgs(MemberName, _value));
+ }
+ #endregion
+
+ protected Crow.Interface crow;
+ protected CVKL.Image uiImage;
+ protected vkvg.Device vkvgDev;
+ bool isRunning;
+
+ protected CrowVkWin() : base()
+ {
+ Thread crowThread = new Thread(crow_thread_func);
+ crowThread.IsBackground = true;
+ crowThread.Start();
+
+ while (crow == null)
+ Thread.Sleep(2);
+
+ initUISurface();
+ }
+
+ protected override void render () {
+ int idx = swapChain.GetNextImage ();
+
+ if (idx < 0) {
+ OnResize ();
+ return;
+ }
+
+ lock (crow.RenderMutex) {
+ presentQueue.Submit (cmds[idx], swapChain.presentComplete, drawComplete[idx]);
+ presentQueue.Present (swapChain, drawComplete[idx]);
+ presentQueue.WaitIdle ();
+ }
+ Thread.Sleep (1);
+ }
+
+ void crow_thread_func () {
+ vkvgDev = new vkvg.Device (instance.Handle, phy.Handle, dev.VkDev.Handle, presentQueue.qFamIndex,
+ vkvg.SampleCount.Sample_8, presentQueue.index);
+
+ crow = new Crow.Interface (vkvgDev, 800, 600);
+
+ isRunning = true;
+ while (isRunning) {
+ crow.Update ();
+ Thread.Sleep (3);
+ }
+
+ crow.Dispose ();
+ vkvgDev.Dispose ();
+ crow = null;
+ }
+
+ void initUISurface () {
+ lock (crow.UpdateMutex) {
+ uiImage?.Dispose ();
+ uiImage = new CVKL.Image (dev, new VkImage ((ulong)crow.surf.VkImage.ToInt64 ()), VkFormat.B8g8r8a8Unorm,
+ VkImageUsageFlags.Sampled, swapChain.Width, swapChain.Height);
+ uiImage.SetName ("uiImage");
+ uiImage.CreateView (VkImageViewType.ImageView2D, VkImageAspectFlags.Color);
+ uiImage.CreateSampler (VkFilter.Nearest, VkFilter.Nearest, VkSamplerMipmapMode.Nearest, VkSamplerAddressMode.ClampToBorder);
+ uiImage.Descriptor.imageLayout = VkImageLayout.ShaderReadOnlyOptimal;
+ }
+ }
+
+ protected virtual void recordDraw (CommandBuffer cmd, int imageIndex) { }
+
+ void buildCommandBuffers () {
+ for (int i = 0; i < swapChain.ImageCount; ++i) {
+ cmds[i]?.Free ();
+ cmds[i] = cmdPool.AllocateAndStart ();
+
+ CommandBuffer cmd = cmds [i];
+
+ recordDraw (cmd, 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 ();
+ }
+ }
+
+ /// <summary>
+ /// rebuild command buffers if needed
+ /// </summary>
+ public override void Update () {
+ if (rebuildBuffers) {
+ buildCommandBuffers ();
+ rebuildBuffers = false;
+ }
+ }
+
+ 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
+ }
+}
\ No newline at end of file