-
-
Notifications
You must be signed in to change notification settings - Fork 423
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
113 changed files
with
21,809 additions
and
5,544 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Website Build | ||
on: | ||
push: | ||
branches: | ||
- 'develop/3.0' | ||
pull_request: | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
Build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build Website | ||
run: | | ||
git submodule update --init eng/submodules/silk.net-2.x | ||
cd eng/submodules/silk.net-2.x | ||
git fetch --all | ||
cd ../../.. | ||
./build.sh website | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Upload artifact | ||
if: ${{ github.repository == 'dotnet/Silk.NET' && github.ref == 'refs/heads/develop/3.0' }} | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: "artifacts/docs/Silk.NET" | ||
Deploy: | ||
if: ${{ github.repository == 'dotnet/Silk.NET' && github.ref == 'refs/heads/develop/3.0' }} | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: Build | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
title: "Overview" | ||
--- | ||
|
||
import DocCardList from '@theme/DocCardList'; | ||
import { useCurrentSidebarCategory } from '@docusaurus/theme-common'; | ||
|
||
# The Silk.NET Contributors Guide | ||
|
||
Welcome to the Silk.NET project! We're so glad you want to help us create the best native interoperation experience that | ||
.NET has ever seen. | ||
|
||
This contributors guide covers many topics about Silk.NET's internals in great detail to help anyone pick up any part of | ||
the codebase and hit the ground running. | ||
|
||
## Table of Contents | ||
|
||
- [Getting Started (you are here!)](#getting-started) | ||
- [Contribution Process](../CONTRIBUTING.md) | ||
- [Build System](build-system.md) | ||
|
||
## Getting Started | ||
|
||
### Prerequisites | ||
|
||
To get started, first clone Silk.NET using `git clone https://github.com/dotnet/Silk.NET --depth 1`. Your development | ||
environment will need the latest production-ready .NET SDK, so make sure you've installed that from | ||
[get.dot.net](https://get.dot.net). We also recommend installing NUKE using `dotnet tool install -g NUKE.GlobalTool` to | ||
enable our auxiliary build commands/utilities, but this is optional and in fact can be accessed using the | ||
`./build.sh`/`.\build.cmd`/`.\build.ps1` scripts in place of `nuke` in usages in this guide without installing the tool. | ||
|
||
If you'd like to build and/or work with the mobile support in Silk.NET, you'll need to install the workloads using | ||
`dotnet workload restore`. It is highly likely you need to prefix this with `sudo` on macOS and Linux. In addition, | ||
you'll need to install the Android SDK with API 34 and API 35 support to ensure a successful build. Furthermore, on | ||
macOS you will need Xcode installed with the iOS platform installed. Alternatively, if you don't want to work with our | ||
mobile support, you can disable it for your local builds using `nuke disable-platforms --platforms android ios` for | ||
example. The acceptable values for `--platforms` are any valid platform identifiers (i.e. right-hand side of the `-` of | ||
a `TargetFramework`, without platform version information). | ||
|
||
We automatically disable iOS support on Linux, as these workloads are only available on Windows and macOS. For more | ||
information about the NUKE utilities, consult the [Build System](build-system.md) documentation or use `nuke --help`. | ||
|
||
### Building from Source | ||
|
||
Assuming you've got the prerequisites installed, `dotnet build`! Or `dotnet pack` to produce all the NuPkgs in | ||
`artifacts/pkg`. | ||
|
||
To learn more about the build system, see the [Build System](build-system.md) documentation. It is intentionally | ||
designed to be as compatible as possible with the regular `dotnet build` system such that you can use the built-in | ||
utilities of your favourite IDE. | ||
|
||
### Regenerating Bindings | ||
|
||
You can regenerate bindings using NUKE with `nuke regenerate-bindings`, but this isn't recommended. A full regeneration | ||
of Silk.NET takes a long time and has the potential to touch the vast majority of the files that make up Silk.NET and/or | ||
create loads of unrelated changes in your working tree. Instead, it is preferred to run SilkTouch manually using a | ||
command like | ||
`dotnet run --project sources/SilkTouch/SilkTouch/Silk.NET.SilkTouch.csproj -c Release -- generator.json -s Job1 -s Job2 ...` | ||
where the values for the `-s` arguments are replaced with the job names (the keys of the `Jobs` dictionary in | ||
`generator.json` e.g. `SDL`, `OpenGL`, etc). | ||
|
||
For more information on SilkTocuh arguments, consult the [SilkTouch User Guide](../silktouch) or use | ||
`dotnet run --project sources/SilkTouch/SilkTouch/Silk.NET.SilkTouch.csproj -- --help`. | ||
|
||
<DocCardList items={useCurrentSidebarCategory().items.filter((e) => e.label != "Overview")} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
title: "Welcome" | ||
id: "index" | ||
description: 'Get Started with Silk.NET' | ||
slug: '/' | ||
--- | ||
|
||
import DocCardList from '@theme/DocCardList'; | ||
import { useDocsSidebar } from '@docusaurus/plugin-content-docs/client' | ||
|
||
# Welcome to Silk.NET! | ||
|
||
## Getting Started | ||
|
||
To get started, install the relevant NuGet packages. They all start with `Silk.NET`, and the next inner namespace after | ||
that indicates the binding or High-Level Utility (HLU, e.g. Windowing or Input) that package belongs. Here' some example | ||
commands to install such NuGet packages: | ||
|
||
```bash | ||
dotnet add package Silk.NET.Assimp | ||
dotnet add package Silk.NET.Input | ||
dotnet add package Silk.NET.Maths | ||
dotnet add package Silk.NET.Direct2D | ||
dotnet add package Silk.NET.Direct3D.Compilers | ||
dotnet add package Silk.NET.Direct3D9 | ||
dotnet add package Silk.NET.Direct3D11 | ||
dotnet add package Silk.NET.Direct3D12 | ||
dotnet add package Silk.NET.DirectComposition | ||
dotnet add package Silk.NET.DirectStorage | ||
dotnet add package Silk.NET.DXGI | ||
dotnet add package Silk.NET.DXVA | ||
dotnet add package Silk.NET.XAudio | ||
dotnet add package Silk.NET.XInput | ||
dotnet add package Silk.NET.OpenAL | ||
dotnet add package Silk.NET.OpenCL | ||
dotnet add package Silk.NET.OpenGL | ||
dotnet add package Silk.NET.OpenGL.Legacy | ||
dotnet add package Silk.NET.OpenGLES | ||
dotnet add package Silk.NET.OpenXR | ||
dotnet add package Silk.NET.Shaderc | ||
dotnet add package Silk.NET.SPIRV.Cross | ||
dotnet add package Silk.NET.SPIRV.Reflect | ||
dotnet add package Silk.NET.Vulkan | ||
dotnet add package Silk.NET.WebGPU | ||
dotnet add package Silk.NET.Windowing | ||
``` | ||
|
||
If you don't know which API you'd like to start with, try OpenGL if you'd like to draw graphics - it's an old but tested | ||
API that has universal compatibility on most platforms. It is succeeded by Vulkan, but there is a large jump in | ||
difficulty thereafter. Alternatively, if you only care about Microsoft platforms, try Direct3D 11! Note that the same | ||
caveat for Vulkan vs OpenGL applies to Direct3D 12 vs Direct3D 11. | ||
|
||
If you can't decide on one for now, we maintain a "metapackage" that pulls in most of Silk.NET's core packages from all | ||
bindings and High-Level Utilities (HLUs). You can install that as follows: | ||
|
||
```bash | ||
dotnet add package Silk.NET | ||
``` | ||
|
||
As always, we're happy to help in our Discord server with whatever questions you have, no matter how far along you are! | ||
|
||
## Find Documentation | ||
|
||
Now that you've pulled in the APIs you would like to use, it's time to find documentation to follow. Most Silk.NET APIs | ||
(other than our High-Level Utilities) map 1:1 directly into a native API signature that should be easily searchable by | ||
its API name (e.g. `glGetString` becomes `GL.GetString` in Silk.NET). Note that these rules are not consistent and it is expected | ||
that you have at least some familiarity with how the native API is structured. | ||
|
||
Of course, there are some bindings for which we have our own introductory documentation for, which presents a good | ||
jumping-off point for new users to Silk.NET - regardless of whether you've used the native API before (e.g. with C/C++) | ||
or you've never seen anything about it before! To that end, you can find our own documentation indexed below or | ||
throughout this site. | ||
|
||
<DocCardList items={useDocsSidebar().items.filter((e) => e.label != "Welcome")} /> | ||
|
||
Have fun! We always look forward to seeing what people can create with Silk.NET and would love to hear how you get on in | ||
[our Discord server](https://discord.gg/DTHHXRt). |
Oops, something went wrong.