EmbreeSharp 0.2.0-alpha

This is a prerelease version of EmbreeSharp.
There is a newer version of this package available.
See the version list below for details.
dotnet add package EmbreeSharp --version 0.2.0-alpha
                    
NuGet\Install-Package EmbreeSharp -Version 0.2.0-alpha
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EmbreeSharp" Version="0.2.0-alpha" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EmbreeSharp" Version="0.2.0-alpha" />
                    
Directory.Packages.props
<PackageReference Include="EmbreeSharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EmbreeSharp --version 0.2.0-alpha
                    
#r "nuget: EmbreeSharp, 0.2.0-alpha"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=EmbreeSharp&version=0.2.0-alpha&prerelease
                    
Install EmbreeSharp as a Cake Addin
#tool nuget:?package=EmbreeSharp&version=0.2.0-alpha&prerelease
                    
Install EmbreeSharp as a Cake Tool

EmbreeSharp

EmbreeSharp is a C# Low-level binding for embree

Target framework is .NET 7

Build

Clone this project.

Put the native libraries into the folder. For example, your OS is win11 x64. You should put embree4.dll, tbb12.dll and tbbmalloc.dll into EmbreeSharp\runtimes\win-x64\native

Now you can build the project by anyway. For example using the cmd dotnet build --configuration Release

This project use Github Action to build automatically. You can check out the build script in .github\workflows\publish.yml for more help

Details

This project use ClangSharp to generate binding code. Generated code with some tweaks.

Currently clangsharp cannot generate bindings for opaque struct. Like RTCDevice, it's actually struct RTCDeviceTy*. We can use System.IntPtr to interop. But for type safety, I think create a C# struct contains a System.IntPtr is the best way.

Unfortunately, I don't know how to autoload the embree which is built by official project. Because it depends on tbb. And tbb is not included in the search path. I use System.Runtime.InteropServices.NativeLibrary.SetDllImportResolver to set custom load logic to support load embree on win, linux and osx.

In the future, I may create some wrapper classes to avoid unsafe API. If you have great idea, welcome PRs!

License

MIT

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.6.5 178 8/4/2024
0.6.4 127 6/15/2024
0.6.3 132 4/25/2024
0.6.2 133 3/13/2024
0.6.1 137 3/12/2024
0.6.0 120 3/12/2024
0.5.0 138 3/9/2024
0.4.1 143 2/19/2024
0.4.0 239 11/29/2023
0.3.0 1,923 4/11/2023
0.2.0 388 4/8/2023
0.2.0-alpha 339 4/7/2023

simple test case