Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ jobs:

- uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.x.x
dotnet-version: |
6.x.x
8.x.x
9.x.x

- run: dotnet test AssimpNet.Test -c ${{ matrix.configuration }} ${{ matrix.additional_args }}

Expand Down
2 changes: 1 addition & 1 deletion AssimpNet.Sample/AssimpNet.Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Assimp.Sample</RootNamespace>
<ApplicationIcon />
<StartupObject />
Expand Down
8 changes: 7 additions & 1 deletion AssimpNet.Test/AssimpNet.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<IsLinux>$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::get_Linux())))</IsLinux>
<TargetFrameworks>net9.0;net8.0;net6.0;net48</TargetFrameworks>
<TargetFrameworks Condition=" '$(IsLinux)' == 'true' ">net9.0;net8.0;net6.0</TargetFrameworks>
<RootNamespace>Assimp.Test</RootNamespace>
<LangVersion>latest</LangVersion>
<ForceCopyNativeAssimp>true</ForceCopyNativeAssimp>
Expand All @@ -15,6 +17,10 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="OpenTK.NETCore" Version="1.1.2749.6433" />
<PackageReference Include="Polyfill" Version="7.24.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 2 additions & 4 deletions AssimpNet.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29728.190
# Visual Studio Version 17
VisualStudioVersion = 17.13.35919.96 d17.13
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssimpNet", "AssimpNet\AssimpNet.csproj", "{EAB14BD7-4180-407A-BB55-D67C9D32F9FE}"
EndProject
Expand All @@ -20,9 +20,7 @@ Global
{EAB14BD7-4180-407A-BB55-D67C9D32F9FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EAB14BD7-4180-407A-BB55-D67C9D32F9FE}.Release|Any CPU.Build.0 = Release|Any CPU
{7EB942AE-787E-4E61-9C71-B868F4C2B53C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7EB942AE-787E-4E61-9C71-B868F4C2B53C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7EB942AE-787E-4E61-9C71-B868F4C2B53C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7EB942AE-787E-4E61-9C71-B868F4C2B53C}.Release|Any CPU.Build.0 = Release|Any CPU
{5C5206C9-691B-4C17-B4E1-E34F40AAC1D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5C5206C9-691B-4C17-B4E1-E34F40AAC1D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5C5206C9-691B-4C17-B4E1-E34F40AAC1D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
12 changes: 11 additions & 1 deletion AssimpNet/AssimpNet.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0</TargetFrameworks>
<IsLinux>$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::get_Linux())))</IsLinux>
<TargetFrameworks>net9.0;net8.0;net6.0;net48</TargetFrameworks>
<TargetFrameworks Condition=" '$(IsLinux)' == 'true' ">net9.0;net8.0;net6.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down Expand Up @@ -44,6 +46,14 @@
<Content Include="AssimpNetter.targets" Link="nuget\build\AssimpNetter.targets" PackagePath="build" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Polyfill" Version="7.24.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Memory" Version="4.6.2" />
</ItemGroup>

<ItemGroup>
<None Include="..\libs\Assimp\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
2 changes: 1 addition & 1 deletion AssimpNet/Material.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,7 @@ public TextureSlot[] GetMaterialTextures(TextureType type)
/// <returns>The array of textures</returns>
public IEnumerable<TextureSlot> GetAllMaterialTextures()
{
return Enum.GetValues<TextureType>().SelectMany(GetMaterialTextures);
return EnumPolyfill.GetValues<TextureType>().SelectMany(GetMaterialTextures);
}

#region IMarshalable Implementation
Expand Down
8 changes: 8 additions & 0 deletions AssimpNet/MemoryHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -613,9 +613,17 @@ public static unsafe void Write<T>(IntPtr pDest, T[] data, int startIndexInArray
/// <param name="count">Number of elements to copy</param>
public static unsafe void Write<T>(IntPtr pDest, List<T> data, int startIndexInArray, int count) where T : struct
{
#if NET48
int sizeT = Unsafe.SizeOf<T>();
for (int i = 0; i < count; i++)
{
Unsafe.Write((void*)(pDest + i * sizeT), data[i]);
}
#else
ReadOnlySpan<T> src = CollectionsMarshal.AsSpan(data).Slice(startIndexInArray, count);
Span<T> dst = new Span<T>(pDest.ToPointer(), count);
src.CopyTo(dst);
#endif
}

/// <summary>
Expand Down