Skip to content

Commit

Permalink
Upgrading to .net 6
Browse files Browse the repository at this point in the history
  • Loading branch information
larsbrubaker committed Jul 16, 2022
1 parent 335f8f2 commit 36ed349
Show file tree
Hide file tree
Showing 247 changed files with 38,412 additions and 3,859 deletions.
75 changes: 13 additions & 62 deletions AForgeCamera/AForgeCamera.csproj
Original file line number Diff line number Diff line change
@@ -1,79 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{9142B0A3-44AD-4CDB-8F71-E54DE2BA7D9B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AForgeCamera</RootNamespace>
<AssemblyName>AForgeCamera</AssemblyName>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>2.0</OldToolsVersion>
<ApplicationRevision>0</ApplicationRevision>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWindowsForms>true</UseWindowsForms>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
<PlatformTarget>x86</PlatformTarget>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Prefer32Bit>false</Prefer32Bit>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<ItemGroup>
<Compile Include="AForgeCamera.cs" />
<Compile Include="CLEyeCamera.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="AForge.Video">
<HintPath>.\AForge.Video.dll</HintPath>
</Reference>
<Reference Include="AForge.Video.DirectShow">
<HintPath>.\AForge.Video.DirectShow.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\agg\Agg.csproj">
<Project>{657dbc6d-c3ea-4398-a3fa-ddb73c14f71b}</Project>
<Name>Agg</Name>
</ProjectReference>
<ProjectReference Include="..\VectorMath\VectorMath.csproj">
<Project>{d3e41b4e-bfbb-44ca-94c8-95c00f754fdd}</Project>
<Name>VectorMath</Name>
</ProjectReference>
<ProjectReference Include="..\agg\Agg.csproj" />
<ProjectReference Include="..\VectorMath\VectorMath.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version="0.3.330701">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Csg/Csg.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Company>MatterHackers Inc.</Company>
<AssemblyName>MatterHackers.Csg</AssemblyName>
<RootNamespace>MatterHackers.Csg</RootNamespace>
Expand Down
4 changes: 2 additions & 2 deletions DataConverters2D/DataConverters2D.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Company>MatterHackers Inc.</Company>
<ReleaseVersion>2.20.12</ReleaseVersion>
<IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</IsWindows>
Expand All @@ -18,7 +18,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.2" />
<PackageReference Include="SixLabors.ImageSharp" Version="2.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
22 changes: 6 additions & 16 deletions DataConverters2D/ImageIO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,26 +171,16 @@ private static bool ConvertImageToImageBuffer(ImageBuffer destImage, SixLabors.I
#else
private static bool ConvertImageToImageBuffer(ImageBuffer imageBuffer, ImageFrame<Rgba32> imageFrame)
{
if (imageFrame.TryGetSinglePixelSpan(out var pixelSpan))
{
Rgba32[] pixelArray = pixelSpan.ToArray();

return ConvertImageToImageBuffer(imageBuffer, imageFrame.Width, imageFrame.Height, pixelArray);
}

return false;
Rgba32[] pixelArray = new Rgba32[imageFrame.Width * imageFrame.Height];
imageFrame.CopyPixelDataTo(pixelArray);
return ConvertImageToImageBuffer(imageBuffer, imageFrame.Width, imageFrame.Height, pixelArray);
}

private static bool ConvertImageToImageBuffer(ImageBuffer destImage, Image<Rgba32> image)
{
if (image.TryGetSinglePixelSpan(out var pixelSpan))
{
Rgba32[] pixelArray = pixelSpan.ToArray();

return ConvertImageToImageBuffer(destImage, image.Width, image.Height, pixelArray);
}

return false;
Rgba32[] pixelArray = new Rgba32[image.Width * image.Height];
image.CopyPixelDataTo(pixelArray);
return ConvertImageToImageBuffer(destImage, image.Width, image.Height, pixelArray);
}

public static bool ConvertImageToImageBuffer(ImageBuffer destImage, int width, int height, Rgba32[] pixelArray)
Expand Down
2 changes: 1 addition & 1 deletion DataConverters3D/DataConverters3D.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Company>MatterHackers Inc.</Company>
<ReleaseVersion>2.20.12</ReleaseVersion>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion DataConverters3D/Object3D/Object3DExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ public static void Rotate(this IObject3D item, Vector3 origin, Vector3 axis, dou
public static ITraceable CreateBVHData(this Mesh mesh, BvhCreationOptions bvhCreationOptions = BvhCreationOptions.LegacySlowConstructionFastTracing)
{
// test new BvHBuilderAac
// return BvhBuilderAac.Create(mesh);
// BvhBuilderAac.Create(mesh);

var allPolys = new List<ITraceable>();

Expand Down
110 changes: 18 additions & 92 deletions Gaming/Gaming.csproj
Original file line number Diff line number Diff line change
@@ -1,114 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{79741A18-3523-41BE-93DB-EECBEF515591}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Gaming</RootNamespace>
<AssemblyName>Gaming</AssemblyName>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>2.0</OldToolsVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>False</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<PlatformTarget>x86</PlatformTarget>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<ItemGroup>
<ProjectReference Include="..\agg\Agg.csproj">
<Project>{657dbc6d-c3ea-4398-a3fa-ddb73c14f71b}</Project>
<Name>Agg</Name>
</ProjectReference>
<ProjectReference Include="..\Gui\Gui.csproj">
<Project>{74f6bb6c-9d02-4512-a59a-21940e35c532}</Project>
<Name>Gui</Name>
</ProjectReference>
<ProjectReference Include="..\VectorMath\VectorMath.csproj">
<Project>{d3e41b4e-bfbb-44ca-94c8-95c00f754fdd}</Project>
<Name>VectorMath</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="Audio\AudioSystem.cs" />
<Compile Include="Audio\Sound.cs" />
<Compile Include="Audio\SoundSource.cs" />
<Compile Include="Editor\EditorWindow.cs" />
<Compile Include="Game\AssetReference.cs" />
<Compile Include="Game\GameDataAttribute.cs" />
<Compile Include="Game\GameDataAttributeTypes.cs" />
<Compile Include="Game\DataAssetCache.cs" />
<Compile Include="Game\DataAssetTree.cs" />
<Compile Include="Game\DataViewGraph.cs" />
<Compile Include="Game\GamePlatform.cs" />
<Compile Include="Graphics\ImageSequence.cs" />
<Compile Include="Core\TranslatedString.cs" />
<Compile Include="Core\TwoSidedStack.cs" />
<Compile Include="Game\GameObject.cs" />
<Compile Include="Math\Helper.cs" />
<ProjectReference Include="..\agg\Agg.csproj" />
<ProjectReference Include="..\Gui\Gui.csproj" />
<ProjectReference Include="..\VectorMath\VectorMath.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="OpenTK, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\PlatformWin32\OpenTK.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Game\Joystick.cs" />
<Compile Remove="Graphics\Model3D.cs" />
<Compile Remove="Graphics\ScreenImageOpenGL.cs" />
<Compile Remove="Math\Vector2D.cs" />
<Compile Remove="Math\Vector3D.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version="0.3.330701">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>
24 changes: 24 additions & 0 deletions Glfw/GlfwPlatformWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ public void ShowSystemWindow(SystemWindow systemWindow)

private void CursorPositionCallback(Window window, double x, double y)
{
if (!IPlatformWindow.EnablePlatformWindowInput)
return;

mouseX = x;
mouseY = aggSystemWindow.Height - y;
WindowProvider.TopWindow.OnMouseMove(new MouseEventArgs(mouseButton, 0, mouseX, mouseY, 0));
Expand All @@ -216,6 +219,12 @@ private void ConditionalDrawAndRefresh(SystemWindow systemWindow)
for (var i = 0; i < this.WindowProvider.OpenWindows.Count; i++)
{
var window = this.WindowProvider.OpenWindows[i];

// Due to handling in CloseSystemWindow, testing can sometimes end up handling a draw event with no PlatformWindow, so skip this window.
// TODO: Unify this stuff with PlatformWin32?
if (window.PlatformWindow == null)
continue;

if (i > 0)
{
window.Size = systemWindow.Size;
Expand All @@ -232,6 +241,9 @@ private void ConditionalDrawAndRefresh(SystemWindow systemWindow)

private void CharCallback(Window window, uint codePoint)
{
if (!IPlatformWindow.EnablePlatformWindowInput)
return;

WindowProvider.TopWindow.OnKeyPress(new KeyPressEventArgs((char)codePoint));
}

Expand Down Expand Up @@ -270,6 +282,9 @@ private void UpdateKeyboard(ModifierKeys theEvent)

private void KeyCallback(Window windowIn, GLFW.Keys key, int scanCode, InputState state, ModifierKeys mods)
{
if (!IPlatformWindow.EnablePlatformWindowInput)
return;

if (state == InputState.Press || state == InputState.Repeat)
{
var keyData = MapKey(key, out bool _);
Expand Down Expand Up @@ -625,6 +640,9 @@ private Cursor MapCursor(Cursors cursorToSet)

private void MouseButtonCallback(Window window, MouseButton button, InputState state, ModifierKeys modifiers)
{
if (!IPlatformWindow.EnablePlatformWindowInput)
return;

var now = UiThread.CurrentTimerMs;
mouseButton = MouseButtons.Left;
switch (button)
Expand Down Expand Up @@ -666,6 +684,9 @@ private void MouseButtonCallback(Window window, MouseButton button, InputState s

private void ScrollCallback(Window window, double x, double y)
{
if (!IPlatformWindow.EnablePlatformWindowInput)
return;

WindowProvider.TopWindow.OnMouseWheel(new MouseEventArgs(MouseButtons.None, 0, mouseX, mouseY, (int)(y * 120)));
}

Expand Down Expand Up @@ -819,6 +840,9 @@ public static string[] IntPtrToStringArray<TGenChar>(int size, IntPtr rRoot) whe

private void DropCallback(Window window, int count, IntPtr array)
{
if (!IPlatformWindow.EnablePlatformWindowInput)
return;

var files = IntPtrToStringArray<byte>(count, array).ToList();

UiThread.RunOnIdle(() =>
Expand Down
2 changes: 1 addition & 1 deletion Glfw/GlfwProvider.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Company>MatterHackers Inc.</Company>
<AssemblyName>MatterHackers.GlfwProvider</AssemblyName>
<ReleaseVersion>2.20.12</ReleaseVersion>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 36ed349

Please sign in to comment.