Silk.NET is your one-stop-shop for high-speed .NET multimedia, graphics, and compute; providing bindings to popular low-level APIs such as OpenGL, OpenCL, OpenAL, OpenXR, GLFW, SDL, Vulkan, Assimp, and DirectX.
Use Silk.NET to spruce up applications with cross-platform 3D graphics, audio, compute and haptics!
Silk.NET works on any .NET Standard 2.0 compliant platform, including .NET 5.0, Xamarin, .NET Framework 4.6.1+, and .NET Core 2.0+.
Features
Performance
Having poured lots of hours into examining generated C# code and its JIT assembly, you can count on us to deliver blazing fast bindings with negligible overhead induced by Silk.NET!
Up-to-date
With an efficient bindings regeneration mechanism, we are committed to ensuring our bindings reflect the latest specifications with monthly updates generated straight from the upstream sources.
High-level utilities
In addition to providing high-speed, direct, and transparent bindings, we provide high-level utilities and wrappers to maximise productivity in common workloads such as platform-agnostic abstractions around Windowing and Input, bringing your apps to a vast number of platforms without changing a single line!
Good-to-go
Silk.NET caters for anything you could need in swift development of multimedia, graphics, compute applications. Silk.NET is an all-in-one solution, complete with Graphics, Compute, Audio, Input, and Windowing.
The team
We currently have the following maintainers:
In addition, the Silk.NET working group help drive larger user-facing changes providing key consultation from the perspective of dedicated users and professionals.
Building from source
Prerequisites
- Must: .NET 6 SDK
- Should: Android (w/ AOT), iOS, and MAUI .NET 6 workloads (use
dotnet workload install android android-aot ios maui
to install them) - Should: Android SDK version 30 with NDK tools installed. On Windows, for best results this should be installed into
C:\ProgramData\Android\android-sdk
. - Could: Java JDK (for gradle)
- Could: Visual Studio 2019 Community version 16.10 or later
Instructions
- Clone the repository (recursively)
- Run build.sh, build.cmd, build.ps1, or
nuke compile
. - Use the DLLs. To get nupkgs you can use with NuGet instead, use
nuke pack
.
There are more advanced build actions you can do too, such as FullBuild, Pack, FullPack, among others which you can view by doing nuke --plan
.
Note: Some .NET 6 workloads are only supported on Windows and macOS today.
Contributing
Silk.NET uses and encourages Early Pull Requests. Please don't wait until you're done to open a PR!
- Fork Silk.NET
- Add an empty commit to a new branch to start your work off:
git commit --allow-empty -m "start of [thing you're working on]"
- Once you've pushed a commit, open a draft pull request. Do this before you actually start working.
- Make your commits in small, incremental steps with clear descriptions.
- Tag a maintainer when you're done and ask for a review!
The Silk.NET solution is very large. As such, to generate a solution that only has the projects you care about for your contribution, use the following command:
nuke sln --projects project1 project2...
. <projects>
can be substitued for:
- A name of an individual project. The Silk.NET prefix can be omitted provided there is no matching subfolder.
- A name of a subfolder in the repo root,
src/
, orexamples/CSharp
Example: nuke sln --projects opengl silk.net.vulkan core.win32extras "opengl tutorials" build
. This:
- matches
opengl
tosrc/OpenGL
- matches
silk.net.vulkan
tosrc/Vulkan/Silk.NET.Vulkan
- matches
core.win32extras
tosrc/Core/Silk.NET.Core.Win32Extras
- matches
"opengl tutorials"
toexamples/CSharp/OpenGL Tutorials
- matches
build
tobuild/
The generated solution is: Silk.NET.gen.sln
Silk.NET requires significant effort to maintain, as such we greatly appreciate any financial support you are able to provide! Funding
This helps ensure Silk.NET's long term viability, and to help support the developers who maintain Silk.NET in their free time. Dylan and Kai are accepting GitHub Sponsorships.
Further resources
- Several examples can be found in the examples folder
- Come chat with us on Discord!
Licensing and governance
Silk.NET is distributed under the very permissive MIT/X11 license and all dependencies are distributed under MIT-compatible licenses.
Silk.NET is a .NET Foundation project, and has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information, see the .NET Foundation Code of Conduct.