diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index d0af823507..5e4f4ff075 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -6,9 +6,17 @@ updates:
schedule:
interval: weekly
day: thursday
+ groups:
+ silk2_deps:
+ patterns:
+ - "*"
- package-ecosystem: nuget
target-branch: develop/3.0
directory: "/"
schedule:
interval: weekly
day: thursday
+ groups:
+ silk3_deps:
+ patterns:
+ - "*"
diff --git a/.github/workflows/public-api.yml b/.github/workflows/public-api.yml
deleted file mode 100644
index 4acf74c18b..0000000000
--- a/.github/workflows/public-api.yml
+++ /dev/null
@@ -1,77 +0,0 @@
-name: Public API
-on:
- push:
- branches:
- - "**"
- create:
- tags:
- - "**"
- pull_request_target:
-permissions:
- issues: write
- pull-requests: write
-jobs:
- Check:
- runs-on: windows-latest
- steps:
- - uses: actions/checkout@v2
- - uses: actions/checkout@v2
- name: Checkout PR
- if: ${{ github.repository == 'dotnet/Silk.NET' && github.event_name == 'pull_request_target' }}
- with:
- repository: ${{ github.event.pull_request.head.repo.full_name }}
- path: inbound_pr
- ref: ${{ github.event.pull_request.head.ref }}
- - uses: actions/checkout@v2
- name: Checkout branch
- if: ${{ github.repository == 'dotnet/Silk.NET' && github.event_name != 'pull_request_target' }}
- with:
- path: inbound_pr
- - name: Cache .tmp, ~/.nuget/packages
- uses: actions/cache@v2
- with:
- path: |
- .tmp
- ~/.nuget/packages
- key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
- - name: Setup .NET 6.0 and .NET 7.0
- uses: actions/setup-dotnet@v3.0.3
- with:
- dotnet-version: |
- 6.0.201
- 7.0.*
- - name: Install Workloads for Restore
- # TODO: This is slow. Maybe we can make a docker container with this already done?
- run: dotnet workload install android ios maccatalyst
- - name: Ensure Public API Declared
- run: ./build.sh EnsureApiDeclared
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- Ship:
- if: ${{ github.repository == 'dotnet/Silk.NET' && github.event_name == 'create' }}
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- with:
- token: ${{ secrets.PUSHABLE_GITHUB_TOKEN }}
- - name: Configure git
- run: |
- git config --local user.email "9011267+dotnet-bot@users.noreply.github.com"
- git config --local user.name "The Silk.NET Automaton"
- - name: Cache .tmp, ~/.nuget/packages
- uses: actions/cache@v2
- with:
- path: |
- .tmp
- ~/.nuget/packages
- key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj') }}
- - name: Setup .NET 6.0 and .NET 7.0
- uses: actions/setup-dotnet@v3.0.3
- with:
- dotnet-version: |
- 6.0.201
- 7.0.*
- - name: Ship Public API
- run: ./build.sh ShipApi
- env:
- PUSHABLE_GITHUB_TOKEN: ${{ secrets.PUSHABLE_GITHUB_TOKEN }}
diff --git a/.github/workflows/publish-site.yml b/.github/workflows/publish-site.yml
index 5fc4b7a07c..629f20b7e5 100644
--- a/.github/workflows/publish-site.yml
+++ b/.github/workflows/publish-site.yml
@@ -3,40 +3,30 @@ on:
push:
branches:
- 'main'
+ paths:
+ - "documentation/**/*"
+ - ".github/workflows/publish-site.yml"
permissions:
contents: read
pages: write
id-token: write
jobs:
Build:
+ environment: github-pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- - name: Setup .NET 5.0
- uses: actions/setup-dotnet@v1
with:
- dotnet-version: 5.0.401
- - name: Setup .NET 6.0
- uses: actions/setup-dotnet@v1
- with:
- dotnet-version: 6.0.201
- - name: Setup .NET 7.0
- uses: actions/setup-dotnet@v1
- with:
- dotnet-version: 7.0.102
- - name: Run Statiq
- run: dotnet run -c Release --project src/Website/Silk.NET.Statiq/Silk.NET.Statiq.csproj -- -l debug --nocache
- - name: Upload artifact
- uses: actions/upload-pages-artifact@v1
- with:
- path: "docs"
- Deploy:
- 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@v1
+ ref: "develop/3.0"
+ ssh-key: ${{ secrets.SILK_ACTIONS_DEPLOY_KEY }}
+ - run: |
+ git submodule update --init --recommend-shallow eng/submodules/silk.net-2.x
+ cd eng/submodules/silk.net-2.x
+ git fetch origin main
+ git checkout FETCH_HEAD
+ cd ../../..
+ git add eng/submodules/silk.net-2.x
+ git config --local user.email "9011267+dotnet-bot@users.noreply.github.com"
+ git config --local user.name "The Silk.NET Automaton"
+ git commit -m "Update Silk.NET 2.X submodule for website"
+ git push
diff --git a/.gitignore b/.gitignore
index cbc9f55cf7..fdecf71755 100644
--- a/.gitignore
+++ b/.gitignore
@@ -481,3 +481,6 @@ src/Website/Silk.NET.Statiq/cache
# As much as I love Mac, really not interested in this litter.
**/.DS_Store
+
+website/
+version.txt
diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json
index a5d23c7e46..b8d0de0b5c 100644
--- a/.nuke/build.schema.json
+++ b/.nuke/build.schema.json
@@ -30,6 +30,10 @@
"type": "boolean",
"description": "If specified, ignores any generated solution present and builds the entire project"
},
+ "AndroidHomeValue": {
+ "type": "string",
+ "description": "Android home. Will be determined from dotnet if not provided"
+ },
"Configuration": {
"type": "string",
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)"
@@ -136,16 +140,28 @@
"type": "string"
}
},
+ "PullBaseSite": {
+ "type": "boolean",
+ "description": "When enabled, pulls the latest changes for local clone of the 3.0 branch to build the website. Automatically true if the local clone doesn't exist yet"
+ },
"Root": {
"type": "string",
"description": "Root directory during build execution"
},
+ "SiteBuildArgs": {
+ "type": "array",
+ "description": "Arguments for website generation on the 3.0 branch",
+ "items": {
+ "type": "string"
+ }
+ },
"Skip": {
"type": "array",
"description": "List of targets to be skipped. Empty list skips all dependencies",
"items": {
"type": "string",
"enum": [
+ "Angle",
"Assimp",
"BuildLibSilkDroid",
"Clean",
@@ -176,6 +192,7 @@
"ValidateSolution",
"Vkd3d",
"VulkanLoader",
+ "Website",
"Wgpu"
]
}
@@ -190,6 +207,7 @@
"items": {
"type": "string",
"enum": [
+ "Angle",
"Assimp",
"BuildLibSilkDroid",
"Clean",
@@ -220,6 +238,7 @@
"ValidateSolution",
"Vkd3d",
"VulkanLoader",
+ "Website",
"Wgpu"
]
}
diff --git a/Directory.Build.props b/Directory.Build.props
new file mode 100644
index 0000000000..8c119d5413
--- /dev/null
+++ b/Directory.Build.props
@@ -0,0 +1,2 @@
+
+
diff --git a/Directory.Build.targets b/Directory.Build.targets
new file mode 100644
index 0000000000..8c119d5413
--- /dev/null
+++ b/Directory.Build.targets
@@ -0,0 +1,2 @@
+
+
diff --git a/README.md b/README.md
index e3c96b0247..0e3d00cd5e 100644
--- a/README.md
+++ b/README.md
@@ -83,9 +83,8 @@ Silk.NET caters for anything you could need in swift development of multimedia,
The team
We currently have the following maintainers:
-- [Kai Jellinghaus](https://github.com/HurricanKai) [
](https://twitter.com/intent/follow?screen_name=KJellinghaus)
-- [Thomas Mizrahi](https://github.com/ThomasMiz)
-- [Beyley Thomas](https://github.com/Beyley)
+- [Andrew Davis](https://github.com/curin) (3.0)
+- [Beyley Thomas](https://github.com/Beyley) (2.X)
In addition, the Silk.NET working group help drive larger user-facing changes providing key consultation from the perspective of dedicated users and professionals.
diff --git a/Silk.NET.sln b/Silk.NET.sln
index 5b6a25d208..fde5fc0fcf 100644
--- a/Silk.NET.sln
+++ b/Silk.NET.sln
@@ -446,12 +446,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenGL Demos", "OpenGL Demo
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AndroidDemo", "examples\CSharp\OpenGL Demos\AndroidDemo\AndroidDemo.csproj", "{380468AD-B44D-456C-8DED-35467D11AC2F}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Website", "Website", "{832251B9-B1A2-450A-8FB8-41F600CCA616}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silk.NET.Statiq", "src\Website\Silk.NET.Statiq\Silk.NET.Statiq.csproj", "{49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silk.NET.Statiq.TableOfContents", "src\Website\Silk.NET.Statiq.TableOfContents\Silk.NET.Statiq.TableOfContents.csproj", "{507ED409-A2FD-43BB-AC7C-778B92BD40CF}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silk.NET.DXVA", "src\Microsoft\Silk.NET.DXVA\Silk.NET.DXVA.csproj", "{28D863B1-B60C-4C08-8661-EB820A5B78D2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silk.NET.Core.Win32Extras", "src\Core\Silk.NET.Core.Win32Extras\Silk.NET.Core.Win32Extras.csproj", "{3E30D674-9282-4297-AD1F-9B233A166308}"
@@ -618,6 +612,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.OpenXR.Extensions.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Assimp.Tests", "src\Assimp\Silk.NET.Assimp.Tests\Silk.NET.Assimp.Tests.csproj", "{12D0A556-7DDF-4902-8911-1DA3F6331149}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Core.Tests", "src\Core\Silk.NET.Core.Tests\Silk.NET.Core.Tests.csproj", "{4D871493-0B88-477A-99A1-3E05561CFAD9}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -2841,30 +2837,6 @@ Global
{380468AD-B44D-456C-8DED-35467D11AC2F}.Release|x86.ActiveCfg = Release|Any CPU
{380468AD-B44D-456C-8DED-35467D11AC2F}.Release|x86.Build.0 = Release|Any CPU
{380468AD-B44D-456C-8DED-35467D11AC2F}.Release|x86.Deploy.0 = Release|Any CPU
- {49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Debug|x64.ActiveCfg = Debug|Any CPU
- {49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Debug|x64.Build.0 = Debug|Any CPU
- {49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Debug|x86.ActiveCfg = Debug|Any CPU
- {49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Debug|x86.Build.0 = Debug|Any CPU
- {49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Release|Any CPU.Build.0 = Release|Any CPU
- {49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Release|x64.ActiveCfg = Release|Any CPU
- {49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Release|x64.Build.0 = Release|Any CPU
- {49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Release|x86.ActiveCfg = Release|Any CPU
- {49ABFB5A-A0AF-45C1-921B-DA30CBDD121F}.Release|x86.Build.0 = Release|Any CPU
- {507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Debug|x64.ActiveCfg = Debug|Any CPU
- {507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Debug|x64.Build.0 = Debug|Any CPU
- {507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Debug|x86.ActiveCfg = Debug|Any CPU
- {507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Debug|x86.Build.0 = Debug|Any CPU
- {507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Release|Any CPU.Build.0 = Release|Any CPU
- {507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Release|x64.ActiveCfg = Release|Any CPU
- {507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Release|x64.Build.0 = Release|Any CPU
- {507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Release|x86.ActiveCfg = Release|Any CPU
- {507ED409-A2FD-43BB-AC7C-778B92BD40CF}.Release|x86.Build.0 = Release|Any CPU
{28D863B1-B60C-4C08-8661-EB820A5B78D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{28D863B1-B60C-4C08-8661-EB820A5B78D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28D863B1-B60C-4C08-8661-EB820A5B78D2}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -3771,6 +3743,18 @@ Global
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Release|x64.Build.0 = Release|Any CPU
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Release|x86.ActiveCfg = Release|Any CPU
{12D0A556-7DDF-4902-8911-1DA3F6331149}.Release|x86.Build.0 = Release|Any CPU
+ {4D871493-0B88-477A-99A1-3E05561CFAD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4D871493-0B88-477A-99A1-3E05561CFAD9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4D871493-0B88-477A-99A1-3E05561CFAD9}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {4D871493-0B88-477A-99A1-3E05561CFAD9}.Debug|x64.Build.0 = Debug|Any CPU
+ {4D871493-0B88-477A-99A1-3E05561CFAD9}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {4D871493-0B88-477A-99A1-3E05561CFAD9}.Debug|x86.Build.0 = Debug|Any CPU
+ {4D871493-0B88-477A-99A1-3E05561CFAD9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4D871493-0B88-477A-99A1-3E05561CFAD9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4D871493-0B88-477A-99A1-3E05561CFAD9}.Release|x64.ActiveCfg = Release|Any CPU
+ {4D871493-0B88-477A-99A1-3E05561CFAD9}.Release|x64.Build.0 = Release|Any CPU
+ {4D871493-0B88-477A-99A1-3E05561CFAD9}.Release|x86.ActiveCfg = Release|Any CPU
+ {4D871493-0B88-477A-99A1-3E05561CFAD9}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -3986,9 +3970,6 @@ Global
{514DED00-4DA3-46D1-B2E8-10CE826CD52D} = {081E7761-B200-4DBF-8950-941464DECACE}
{2F547104-C74A-4A84-8980-D1B973CC40C1} = {6842A2C6-5C7B-42DD-9825-0EDE91BFEBF7}
{380468AD-B44D-456C-8DED-35467D11AC2F} = {2F547104-C74A-4A84-8980-D1B973CC40C1}
- {832251B9-B1A2-450A-8FB8-41F600CCA616} = {16AFCF73-8CC1-4B5D-8969-A90F468DC6D5}
- {49ABFB5A-A0AF-45C1-921B-DA30CBDD121F} = {832251B9-B1A2-450A-8FB8-41F600CCA616}
- {507ED409-A2FD-43BB-AC7C-778B92BD40CF} = {832251B9-B1A2-450A-8FB8-41F600CCA616}
{28D863B1-B60C-4C08-8661-EB820A5B78D2} = {F2CF5D32-4B41-425E-B229-8FFC48F88063}
{3E30D674-9282-4297-AD1F-9B233A166308} = {0651C5EF-50AA-4598-8D9C-8F210ADD8490}
{C04680A3-C92A-4631-BD1E-8E4553A3F969} = {2F547104-C74A-4A84-8980-D1B973CC40C1}
@@ -4072,6 +4053,7 @@ Global
{25ABCA5E-4FF6-43ED-9A5E-443E1373EC5C} = {90471225-AC23-424E-B62E-F6EC4C6ECAC0}
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5} = {90471225-AC23-424E-B62E-F6EC4C6ECAC0}
{12D0A556-7DDF-4902-8911-1DA3F6331149} = {6EADA376-E83F-40B7-9539-71DD17AEF7A4}
+ {4D871493-0B88-477A-99A1-3E05561CFAD9} = {0651C5EF-50AA-4598-8D9C-8F210ADD8490}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F5273D7F-3334-48DF-94E3-41AE6816CD4D}
diff --git a/build/nuke/Build.Website.cs b/build/nuke/Build.Website.cs
new file mode 100644
index 0000000000..404512d719
--- /dev/null
+++ b/build/nuke/Build.Website.cs
@@ -0,0 +1,69 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using Nuke.Common;
+using Serilog;
+using System.IO;
+using System;
+using System.Linq;
+using Nuke.Common.Tooling;
+using static Nuke.Common.IO.FileSystemTasks;
+using static Nuke.Common.Tools.Git.GitTasks;
+
+partial class Build
+{
+ [Parameter
+ (
+ "When enabled, pulls the latest changes for local clone of the 3.0 branch to build the website. Automatically true if the local clone doesn't exist yet."
+ )]
+ readonly bool PullBaseSite;
+
+ [Parameter("Arguments for website generation on the 3.0 branch.")]
+ readonly string[]? SiteBuildArgs;
+
+ Target Website => CommonTarget
+ (
+ x => x.Executes
+ (
+ () =>
+ {
+ string? path;
+ if (!File.Exists(RootDirectory / "dir.log") || !Directory.Exists(path = File.ReadAllText(RootDirectory / "dir.log")))
+ {
+ Log.Information("3.0 clone not found, cloning...");
+ path = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
+ Directory.CreateDirectory(path);
+ Git($"clone \"https://github.com/dotnet/Silk.NET\" --depth 1 --branch develop/3.0 {path}");
+ File.WriteAllText(RootDirectory / "dir.log", path);
+ }
+ else if (PullBaseSite)
+ {
+ if (Directory.Exists($"{path}/eng/submodules/silk.net-2.x/documentation"))
+ {
+ Directory.Delete($"{path}/eng/submodules/silk.net-2.x/documentation", true);
+ }
+
+ if (File.Exists($"{path}/eng/submodules/silk.net-2.x/documentation/version.txt"))
+ {
+ File.Delete($"{path}/eng/submodules/silk.net-2.x/documentation/version.txt");
+ }
+
+ Git("pull", path);
+ }
+ else
+ {
+ Directory.Delete($"{path}/eng/submodules/silk.net-2.x/documentation", true);
+ }
+ CopyDirectoryRecursively(RootDirectory / "documentation", $"{path}/eng/submodules/silk.net-2.x/documentation");
+ File.WriteAllText($"{path}/eng/submodules/silk.net-2.x/documentation/version.txt", Git($"describe --tags --abbrev=0").First(x => x.Type == OutputType.Std).Text.Trim());
+ InheritedShell($"{(OperatingSystem.IsWindows() ? ".\\build.cmd" : "./build.sh")} website {string.Join(' ', (SiteBuildArgs ?? Enumerable.Empty()).Select(x => $"--{x}"))}", path).AssertZeroExitCode();
+ if (Directory.Exists(RootDirectory / "website"))
+ {
+ Directory.Delete(RootDirectory / "website", true);
+ }
+
+ CopyDirectoryRecursively($"{path}/artifacts/docs", RootDirectory / "website");
+ }
+ )
+ );
+}
diff --git a/build/nuke/Silk.NET.NUKE.csproj.DotSettings b/build/nuke/Silk.NET.NUKE.csproj.DotSettings
index 7bc28484c4..0306022356 100644
--- a/build/nuke/Silk.NET.NUKE.csproj.DotSettings
+++ b/build/nuke/Silk.NET.NUKE.csproj.DotSettings
@@ -16,6 +16,8 @@
False
<Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
<Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
+ <Policy><Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"><ElementKinds><Kind Name="FIELD" /><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></Policy>
+ <Policy><Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static fields (private)"><ElementKinds><Kind Name="FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" WarnAboutPrefixesAndSuffixes="False" Prefix="" Suffix="" Style="AaBb" /></Policy>
True
True
True
@@ -24,4 +26,5 @@
True
True
True
- True
+ True
+ True
diff --git a/documentation/runner-setup.md b/documentation/for-contributors/runner-setup.md
similarity index 100%
rename from documentation/runner-setup.md
rename to documentation/for-contributors/runner-setup.md
diff --git a/website/docs/hlu/troubleshooting.md b/documentation/hlu/troubleshooting.md
similarity index 100%
rename from website/docs/hlu/troubleshooting.md
rename to documentation/hlu/troubleshooting.md
diff --git a/website/images/assimp.png b/documentation/images/assimp.png
similarity index 100%
rename from website/images/assimp.png
rename to documentation/images/assimp.png
diff --git a/website/images/blog/apr-2023/bigmarkattemptdark.png b/documentation/images/blog/apr-2023/bigmarkattemptdark.png
similarity index 100%
rename from website/images/blog/apr-2023/bigmarkattemptdark.png
rename to documentation/images/blog/apr-2023/bigmarkattemptdark.png
diff --git a/website/images/blog/apr-2023/wgpuquad.png b/documentation/images/blog/apr-2023/wgpuquad.png
similarity index 100%
rename from website/images/blog/apr-2023/wgpuquad.png
rename to documentation/images/blog/apr-2023/wgpuquad.png
diff --git a/website/images/blog/dec-2020/Silk20TeaseSmaller-pre4.png b/documentation/images/blog/dec-2020/Silk20TeaseSmaller-pre4.png
similarity index 100%
rename from website/images/blog/dec-2020/Silk20TeaseSmaller-pre4.png
rename to documentation/images/blog/dec-2020/Silk20TeaseSmaller-pre4.png
diff --git a/website/images/blog/dec-2020/silk20pre5image.png b/documentation/images/blog/dec-2020/silk20pre5image.png
similarity index 100%
rename from website/images/blog/dec-2020/silk20pre5image.png
rename to documentation/images/blog/dec-2020/silk20pre5image.png
diff --git a/website/images/blog/dec-2021/structure-chaining.png b/documentation/images/blog/dec-2021/structure-chaining.png
similarity index 100%
rename from website/images/blog/dec-2021/structure-chaining.png
rename to documentation/images/blog/dec-2021/structure-chaining.png
diff --git a/website/images/blog/feb-2021/Blank-diagram-1--1.png b/documentation/images/blog/feb-2021/Blank-diagram-1--1.png
similarity index 100%
rename from website/images/blog/feb-2021/Blank-diagram-1--1.png
rename to documentation/images/blog/feb-2021/Blank-diagram-1--1.png
diff --git a/website/images/blog/feb-2021/sbt.png b/documentation/images/blog/feb-2021/sbt.png
similarity index 100%
rename from website/images/blog/feb-2021/sbt.png
rename to documentation/images/blog/feb-2021/sbt.png
diff --git a/website/images/blog/jan-2021/sn20.png b/documentation/images/blog/jan-2021/sn20.png
similarity index 100%
rename from website/images/blog/jan-2021/sn20.png
rename to documentation/images/blog/jan-2021/sn20.png
diff --git a/website/images/blog/jan-2022/silkcommunity.png b/documentation/images/blog/jan-2022/silkcommunity.png
similarity index 100%
rename from website/images/blog/jan-2022/silkcommunity.png
rename to documentation/images/blog/jan-2022/silkcommunity.png
diff --git a/website/images/blog/mar-2021/DotNetBotNextUp.png b/documentation/images/blog/mar-2021/DotNetBotNextUp.png
similarity index 100%
rename from website/images/blog/mar-2021/DotNetBotNextUp.png
rename to documentation/images/blog/mar-2021/DotNetBotNextUp.png
diff --git a/website/images/blog/nov-2020/triangledroid.jpg b/documentation/images/blog/nov-2020/triangledroid.jpg
similarity index 100%
rename from website/images/blog/nov-2020/triangledroid.jpg
rename to documentation/images/blog/nov-2020/triangledroid.jpg
diff --git a/website/images/blog/nov-2021/dotnet-bot-selfie-stick.png b/documentation/images/blog/nov-2021/dotnet-bot-selfie-stick.png
similarity index 100%
rename from website/images/blog/nov-2021/dotnet-bot-selfie-stick.png
rename to documentation/images/blog/nov-2021/dotnet-bot-selfie-stick.png
diff --git a/website/images/dotnetfoundation.png b/documentation/images/dotnetfoundation.png
similarity index 100%
rename from website/images/dotnetfoundation.png
rename to documentation/images/dotnetfoundation.png
diff --git a/website/images/dx12ultimate.png b/documentation/images/dx12ultimate.png
similarity index 100%
rename from website/images/dx12ultimate.png
rename to documentation/images/dx12ultimate.png
diff --git a/website/images/glfw.png b/documentation/images/glfw.png
similarity index 100%
rename from website/images/glfw.png
rename to documentation/images/glfw.png
diff --git a/website/images/logo.png b/documentation/images/logo.png
similarity index 100%
rename from website/images/logo.png
rename to documentation/images/logo.png
diff --git a/website/images/logo.svg b/documentation/images/logo.svg
similarity index 100%
rename from website/images/logo.svg
rename to documentation/images/logo.svg
diff --git a/website/images/logo64.png b/documentation/images/logo64.png
similarity index 100%
rename from website/images/logo64.png
rename to documentation/images/logo64.png
diff --git a/website/images/openal.png b/documentation/images/openal.png
similarity index 100%
rename from website/images/openal.png
rename to documentation/images/openal.png
diff --git a/website/images/opencl.svg b/documentation/images/opencl.svg
similarity index 100%
rename from website/images/opencl.svg
rename to documentation/images/opencl.svg
diff --git a/website/images/opengl.jpg b/documentation/images/opengl.jpg
similarity index 100%
rename from website/images/opengl.jpg
rename to documentation/images/opengl.jpg
diff --git a/website/images/opengl/chapter1/cornflower-window.png b/documentation/images/opengl/chapter1/cornflower-window.png
similarity index 100%
rename from website/images/opengl/chapter1/cornflower-window.png
rename to documentation/images/opengl/chapter1/cornflower-window.png
diff --git a/website/images/opengl/chapter1/final-result-t2.png b/documentation/images/opengl/chapter1/final-result-t2.png
similarity index 100%
rename from website/images/opengl/chapter1/final-result-t2.png
rename to documentation/images/opengl/chapter1/final-result-t2.png
diff --git a/website/images/opengl/chapter1/lesson3/example_mipmap.png b/documentation/images/opengl/chapter1/lesson3/example_mipmap.png
similarity index 100%
rename from website/images/opengl/chapter1/lesson3/example_mipmap.png
rename to documentation/images/opengl/chapter1/lesson3/example_mipmap.png
diff --git a/website/images/opengl/chapter1/lesson3/messed-up-quad.png b/documentation/images/opengl/chapter1/lesson3/messed-up-quad.png
similarity index 100%
rename from website/images/opengl/chapter1/lesson3/messed-up-quad.png
rename to documentation/images/opengl/chapter1/lesson3/messed-up-quad.png
diff --git a/website/images/opengl/chapter1/lesson3/mipmap_comparation.png b/documentation/images/opengl/chapter1/lesson3/mipmap_comparation.png
similarity index 100%
rename from website/images/opengl/chapter1/lesson3/mipmap_comparation.png
rename to documentation/images/opengl/chapter1/lesson3/mipmap_comparation.png
diff --git a/website/images/opengl/chapter1/lesson3/quad-with-texture.png b/documentation/images/opengl/chapter1/lesson3/quad-with-texture.png
similarity index 100%
rename from website/images/opengl/chapter1/lesson3/quad-with-texture.png
rename to documentation/images/opengl/chapter1/lesson3/quad-with-texture.png
diff --git a/website/images/opengl/chapter1/lesson3/quad-with-transparency.png b/documentation/images/opengl/chapter1/lesson3/quad-with-transparency.png
similarity index 100%
rename from website/images/opengl/chapter1/lesson3/quad-with-transparency.png
rename to documentation/images/opengl/chapter1/lesson3/quad-with-transparency.png
diff --git a/website/images/opengl/chapter1/lesson3/quad-with-uvs-and-numbers.png b/documentation/images/opengl/chapter1/lesson3/quad-with-uvs-and-numbers.png
similarity index 100%
rename from website/images/opengl/chapter1/lesson3/quad-with-uvs-and-numbers.png
rename to documentation/images/opengl/chapter1/lesson3/quad-with-uvs-and-numbers.png
diff --git a/website/images/opengl/chapter1/lesson3/quad-with-uvs.png b/documentation/images/opengl/chapter1/lesson3/quad-with-uvs.png
similarity index 100%
rename from website/images/opengl/chapter1/lesson3/quad-with-uvs.png
rename to documentation/images/opengl/chapter1/lesson3/quad-with-uvs.png
diff --git a/website/images/opengl/chapter1/lesson3/right-pointers.png b/documentation/images/opengl/chapter1/lesson3/right-pointers.png
similarity index 100%
rename from website/images/opengl/chapter1/lesson3/right-pointers.png
rename to documentation/images/opengl/chapter1/lesson3/right-pointers.png
diff --git a/website/images/opengl/chapter1/lesson3/texParameters/clampToEdge.png b/documentation/images/opengl/chapter1/lesson3/texParameters/clampToEdge.png
similarity index 100%
rename from website/images/opengl/chapter1/lesson3/texParameters/clampToEdge.png
rename to documentation/images/opengl/chapter1/lesson3/texParameters/clampToEdge.png
diff --git a/website/images/opengl/chapter1/lesson3/texParameters/filter_linear.png b/documentation/images/opengl/chapter1/lesson3/texParameters/filter_linear.png
similarity index 100%
rename from website/images/opengl/chapter1/lesson3/texParameters/filter_linear.png
rename to documentation/images/opengl/chapter1/lesson3/texParameters/filter_linear.png
diff --git a/website/images/opengl/chapter1/lesson3/texParameters/filter_nearest.png b/documentation/images/opengl/chapter1/lesson3/texParameters/filter_nearest.png
similarity index 100%
rename from website/images/opengl/chapter1/lesson3/texParameters/filter_nearest.png
rename to documentation/images/opengl/chapter1/lesson3/texParameters/filter_nearest.png
diff --git a/website/images/opengl/chapter1/lesson3/texParameters/repeat.png b/documentation/images/opengl/chapter1/lesson3/texParameters/repeat.png
similarity index 100%
rename from website/images/opengl/chapter1/lesson3/texParameters/repeat.png
rename to documentation/images/opengl/chapter1/lesson3/texParameters/repeat.png
diff --git a/website/images/opengl/chapter1/lesson3/texParameters/repeatMirrored.png b/documentation/images/opengl/chapter1/lesson3/texParameters/repeatMirrored.png
similarity index 100%
rename from website/images/opengl/chapter1/lesson3/texParameters/repeatMirrored.png
rename to documentation/images/opengl/chapter1/lesson3/texParameters/repeatMirrored.png
diff --git a/website/images/opengl/chapter1/lesson3/wrong-pointers.png b/documentation/images/opengl/chapter1/lesson3/wrong-pointers.png
similarity index 100%
rename from website/images/opengl/chapter1/lesson3/wrong-pointers.png
rename to documentation/images/opengl/chapter1/lesson3/wrong-pointers.png
diff --git a/website/images/opengl/chapter1/loading-rendering.png b/documentation/images/opengl/chapter1/loading-rendering.png
similarity index 100%
rename from website/images/opengl/chapter1/loading-rendering.png
rename to documentation/images/opengl/chapter1/loading-rendering.png
diff --git a/website/images/opengl/chapter1/vertex_attribute_pointer.png b/documentation/images/opengl/chapter1/vertex_attribute_pointer.png
similarity index 100%
rename from website/images/opengl/chapter1/vertex_attribute_pointer.png
rename to documentation/images/opengl/chapter1/vertex_attribute_pointer.png
diff --git a/website/images/opengl/chapter1/window1.png b/documentation/images/opengl/chapter1/window1.png
similarity index 100%
rename from website/images/opengl/chapter1/window1.png
rename to documentation/images/opengl/chapter1/window1.png
diff --git a/website/images/opengl/chapter1/wireframe-quad.png b/documentation/images/opengl/chapter1/wireframe-quad.png
similarity index 100%
rename from website/images/opengl/chapter1/wireframe-quad.png
rename to documentation/images/opengl/chapter1/wireframe-quad.png
diff --git a/website/images/opengles.png b/documentation/images/opengles.png
similarity index 100%
rename from website/images/opengles.png
rename to documentation/images/opengles.png
diff --git a/website/images/openxr.svg b/documentation/images/openxr.svg
similarity index 100%
rename from website/images/openxr.svg
rename to documentation/images/openxr.svg
diff --git a/website/images/sdl.png b/documentation/images/sdl.png
similarity index 100%
rename from website/images/sdl.png
rename to documentation/images/sdl.png
diff --git a/website/images/stride.svg b/documentation/images/stride.svg
similarity index 100%
rename from website/images/stride.svg
rename to documentation/images/stride.svg
diff --git a/website/images/vulkan.svg b/documentation/images/vulkan.svg
similarity index 100%
rename from website/images/vulkan.svg
rename to documentation/images/vulkan.svg
diff --git a/website/images/wordmark.svg b/documentation/images/wordmark.svg
similarity index 100%
rename from website/images/wordmark.svg
rename to documentation/images/wordmark.svg
diff --git a/website/images/wordmarkw.svg b/documentation/images/wordmarkw.svg
similarity index 100%
rename from website/images/wordmarkw.svg
rename to documentation/images/wordmarkw.svg
diff --git a/website/images/xplatpromo.png b/documentation/images/xplatpromo.png
similarity index 100%
rename from website/images/xplatpromo.png
rename to documentation/images/xplatpromo.png
diff --git a/documentation/index.mdx b/documentation/index.mdx
new file mode 100644
index 0000000000..15f1cd7c66
--- /dev/null
+++ b/documentation/index.mdx
@@ -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.
+
+ 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).
diff --git a/website/docs/opengl/c1/1-hello-window.md b/documentation/opengl/c1/1-hello-window.md
similarity index 93%
rename from website/docs/opengl/c1/1-hello-window.md
rename to documentation/opengl/c1/1-hello-window.md
index 40f75bb023..b2d9d91970 100644
--- a/website/docs/opengl/c1/1-hello-window.md
+++ b/documentation/opengl/c1/1-hello-window.md
@@ -1,19 +1,12 @@
---
-{
- "TableOfContents": {
- "Name": "1.1 - Hello Window",
- "Url": "1-hello-window.html",
- "Metadata": {
- "AuthorGitHub": "ohtrobinson",
- "DateTimeWritten": "02/11/2022 12:00",
- "PreviewImage": ""
- }
- }
-}
+sidebar_position: 1
+slug: 1-hello-window
---
-# 1.1 - Hello Window
-# Info "You can view the source code for this tutorial [here](../sources/1.1-final-result.html)." /?>
+# Hello Window
+
+> [!NOTE]
+> You can view the source code for this tutorial [here](https://github.com/dotnet/Silk.NET/tree/main/examples/CSharp/OpenGL%20Tutorials/Tutorial%201.1%20-%20Hello%20Window).
## Introduction
Welcome to your first Silk.NET tutorial!
@@ -123,7 +116,7 @@ _window.Run();
And that's it! Run the program and you should hopefully see a window.
-
+
## Window Events
The window we've just created has several events we can subscribe to, such as loading and rendering, which are key for your program to work properly.
@@ -145,7 +138,9 @@ private static void OnRender(double deltaTime) { }
These are the methods that will power our main application. For this tutorial, we'll only be using `OnLoad`, but it's helpful to have all three.
-# Info "The `deltaTime` parameter is the amount of time, in seconds, that has passed since the last frame. Using delta time is key for framerate-independent actions, such as movement." /?>
+
+> [!NOTE]
+> The `deltaTime` parameter is the amount of time, in seconds, that has passed since the last frame. Using delta time is key for framerate-independent actions, such as movement.
Next, we need to subscribe to these events. Add the following code to your `Main` method, just after you call `Window.Create()`:
@@ -157,7 +152,7 @@ _window.Render += OnRender;
Launch your program again and you will see that... nothing has changed. Good! That means it's working correctly. Try adding some logs in the load, update, and render methods to see exactly when they are called.
-
+
We're now ready to handle some input!
@@ -268,4 +263,4 @@ public class Program
}
```
-You can also view this on its own [here](../sources/1.1-final-result.html).
\ No newline at end of file
+You can also view this on its own [here](../sources/1.1-final-result.html).
diff --git a/website/docs/opengl/c1/2-hello-quad.md b/documentation/opengl/c1/2-hello-quad.md
similarity index 92%
rename from website/docs/opengl/c1/2-hello-quad.md
rename to documentation/opengl/c1/2-hello-quad.md
index e227a92c75..492c5be688 100644
--- a/website/docs/opengl/c1/2-hello-quad.md
+++ b/documentation/opengl/c1/2-hello-quad.md
@@ -1,19 +1,13 @@
---
-{
- "TableOfContents": {
- "Name": "1.2 - Hello Quad",
- "Url": "2-hello-quad.html",
- "Metadata": {
- "AuthorGitHub": "ohtrobinson",
- "DateTimeWritten": "02/11/2022 12:00",
- "PreviewImage": ""
- }
- }
-}
+sidebar_position: 2
+sidebar_label: Hello Quad
+slug: 2-hello-quad
---
# 1.2 - Hello Quad
-# Info "You can view the source code for this tutorial [here](../sources/1.2-final-result.html). This tutorial builds on the previous tutorial. If you haven't read it, you can do so [here](1-hello-window.html)." /?>
+
+> [!NOTE]
+> You can view the source code for this tutorial [here](https://github.com/dotnet/Silk.NET/tree/main/examples/CSharp/OpenGL%20Tutorials/Tutorial%201.2%20-%20Hello%20Quad).
Let's draw something on-screen! In this tutorial, you'll learn:
@@ -49,19 +43,21 @@ _gl = _window.CreateOpenGL();
What are we doing here? Silk.NET requires you to keep a **reference** to the OpenGL API. If you've used or seen OpenGL in C, you'll notice that this is different to the way that it is done there. This is done so that you can more easily keep track of multiple contexts. If you don't know what that is, don't worry about it for now, we won't be using it in these tutorials.
-# Info "If you take a look at the source in the Silk.NET samples repository, you will notice that it uses `_gl = GL.GetApi(_window)`. This is another way to get the GL API, however when using Silk.NET windowing, it's recommended that you use `_window.CreateOpenGL()` instead." /?>
+> [!NOTE]
+> If you take a look at the source in the Silk.NET samples repository, you will notice that it uses `_gl = GL.GetApi(_window)`. This is another way to get the GL API, however when using Silk.NET windowing, it's recommended that you use `_window.CreateOpenGL()` instead.
Now, run your application again. If all is good, you should see no change. Awesome! Let's do our first steps in OpenGL: Clearing the window.
## Clearing the window
-Before we start this, let's take a look at what makes up an OpenGL window.
+Before we start this, let's take a look at what makes up an OpenGL window.
A window contains at least two **framebuffers**. A framebuffer is a set of textures that can be rendered to. An OpenGL window's framebuffer consists of the following textures:
* Color texture
* Depth stencil texture
-# Info "The technical name for these textures is **buffers**. For simplicity reasons we will call them textures here, as to not confuse you with the buffers we use later in the tutorial." /?>
+> [!NOTE]
+> The technical name for these textures is **buffers**. For simplicity reasons we will call them textures here, as to not confuse you with the buffers we use later in the tutorial.
On top of this, a window will contain at least two of these framebuffers. This is known as **double-buffering** and is imperative for rendering to work properly. One buffer is displayed, while another is rendered to. They are then swapped between once the GPU is ready.
@@ -93,7 +89,7 @@ _gl.Clear(ClearBufferMask.ColorBufferBit);
Run your application again, and you should see a lovely sky blue window!
-
+
Congrats! You've done your first thing in OpenGL! Didn't work? Check the [source code](../sources/1.2.2-clear-window.html) for this section here.
@@ -107,7 +103,7 @@ Before we can continue further, you'll have to get used to the concept that Open
### What is a state machine?
At its core, a state machine holds... state. You set the state of something, and it retains that state until you change it.
-This is exactly how OpenGL works. Once you set something, it will remain set until you change it. This counts for everything in OpenGL. Clear color, binding objects, etc etc, everything goes through the state machine. You can *manipulate* the current state, however you have to be wary at all times of what part of the state you are changing. Change the wrong thing and suddenly you program might not work!
+This is exactly how OpenGL works. Once you set something, it will remain set until you change it. This counts for everything in OpenGL. Clear color, binding objects, etc etc, everything goes through the state machine. You can *manipulate* the current state, however you have to be wary at all times of what part of the state you are changing. Change the wrong thing and suddenly your program might not work!
So, this explains why clearing the window works. You set the clear color, and it remains *as* the clear color until you change it.
@@ -172,7 +168,7 @@ In modern graphics programming, you are expected to use triangles, lines, or poi
Therefore, a quad is made of two right-angle triangles. This can best be seen if we view the result in **wireframe** mode.
-
+
In the image, you can also see where the four vertices go in relation to the quad. While you won't *usually* be defining vertices yourself, it's still handy to know how it works.
@@ -206,7 +202,8 @@ Let's fill our buffer with some data! Before we do that though, you need to be a
#### Unsafe C#
Silk.NET heavily uses `unsafe` code. Don't worry, this won't make your computer explode, however it does exit out of the "memory safe" managed environment of C#, and enters a realm where undefined behavior, segmentation faults, and strange results are more likely to occur if you are not careful. Since we're working with low-level APIs, and OpenGL is defined in plain C, some unsafe code will be necessary in order for us to be able to communicate with it from C#.
-# Info "If you wish to use `Span` instead, and remain in `safe` mode, Silk.NET does support these too. However, I will be using `unsafe` in this tutorial instead, as this is both what I personally use, as well as what the samples use." /?>
+> [!NOTE]
+> If you wish to use `Span` instead, and remain in `safe` mode, Silk.NET does support these too. However, I will be using `unsafe` in this tutorial instead, as this is both what I personally use, as well as what the samples use.
Unsafe mode is not enabled by default, so we need to enable it. To enable it:
- If you're on Visual Studio 2022, open your project properties and under Build --> General, make sure the box that says "Unsafe code" is checked.
@@ -265,7 +262,7 @@ Now, you may be looking at this thinking "what is this?". Don't worry, once you
You'll notice that it contains 6 values. These values correspond to an index in our vertex buffer (notice how the maximum value is 3, which is the maximum index in our vertex buffer.)
-Take a look at the [image you saw earlier](#what-makes-up-a-quad). The points are representitive of a value in the vertex buffer. If you trace each point, you'll see it's in clockwise order (top left is the first point, bottom left is the last point). Assign each of these an incrementing value from 0-3. Then, trace out the indices we defined above. You may notice that you'll trace out two triangles, making up our quad.
+Take a look at the [image you saw earlier](#what-makes-up-a-quad). The points are representitive of a value in the vertex buffer. If you trace each point, you'll see it's in clockwise order (top left is the first point, bottom left is the last point). Assign each of these an incrementing value from 0-3. Then, trace out the indices we defined above. You may notice that you'll trace out two triangles, making up our quad.
Great! Hopefully you now have a better understanding of how index buffers allow you to reduce the amount of duplicate data in the vertex buffer. If we didn't use an index buffer, we'd have to define the top left, and bottom left points twice!
@@ -457,7 +454,8 @@ The last thing we need to do before we can begin drawing our quad to the screen
This is done with the **attribute setup**. This sets various parameters in the VAO, which tells OpenGL how to read the vertex data in the vertex buffer. As vertex buffers can contain more than just position data (it can contain almost anything you want), it is vital that OpenGL knows how to separate out the individual bits of data, so it can pass it to the shader correctly.
-# Warning "While fragment shaders (and other shaders) can have `in` attributes, the only ones you can directly set *outside* of a shader are the ones going into the vertex shader. The only way to set attributes in the fragment shader is to pass them through the vertex shader. Therefore, the attribute setup only affects the vertex shader and vertex buffer, not any other shader." /?>
+> [!WARNING]
+> While fragment shaders (and other shaders) can have `in` attributes, the only ones you can directly set *outside* of a shader are the ones going into the vertex shader. The only way to set attributes in the fragment shader is to pass them through the vertex shader. Therefore, the attribute setup only affects the vertex shader and vertex buffer, not any other shader.
Add the following to your `OnLoad` method:
@@ -479,7 +477,7 @@ The stride tells OpenGL the size (in bytes) of a *single* vertex. The offset tel
This diagram gives a visual explanation of what stride and offset do (credit to LearnOpenGL):
-
+
In our example, the only things we define per vertex is the position of the vertex itself, which is 3 values per vertex. Therefore, our stride is just `3 * sizeof(float)` (remember, stride is in **bytes**, so we must multiply by the size of the float primitive). Since we are only defining one attribute, we don't need to have any offset. Therefore, we can just use `0`. OpenGL expects a `void` pointer, so we must cast it to `void*`.
@@ -496,7 +494,8 @@ _gl.BindBuffer(BufferTargetARB.ElementArrayBuffer, 0);
Doing this means we've "un-bound" everything, so calling something like `BufferData` won't affect the buffers we've just created.
-# Warning "You **MUST** unbind the vertex array first, before unbinding the other buffers. If you forget to do it in this order, the buffer will be unbound from the vertex array, meaning you'll see incorrect results when you render the object." /?>
+> [!WARNING]
+> You **MUST** unbind the vertex array first, before unbinding the other buffers. If you forget to do it in this order, the buffer will be unbound from the vertex array, meaning you'll see incorrect results when you render the object.
If you want to see the resulting code so far, you can see it [here](../sources/1.2.7-finished-setup.html).
@@ -517,11 +516,11 @@ Let's explain what's going on here.
First, we bind our vertex array. Before we can draw anything, we need to have a vertex array bound. The vertex array you bind will depend on what you want to draw. Next, we use the program object we created earlier. Again, we must have a program bound before we can draw.
-Finally, we tell the GPU to draw. We're using `glDrawElements` here, as we used an EBO. If we didn't use an EBO, we'd want to use `glDrawArrays` instead.
+Finally, we tell the GPU to draw. We're using `glDrawElements` here, as we used an EBO. If we didn't use an EBO, we'd want to use `glDrawArrays` instead.
-The first parameter tells it that we're drawing triangles (triangle list to be precise, there are other triangle types we don't need to worry about for now.).
+The first parameter tells it that we're drawing triangles (triangle list to be precise, there are other triangle types we don't need to worry about for now.).
-The `6` is simply the number of elements in our EBO. Remember, a quad is two triangles, with three vertices per triangle, making six vertices total.
+The `6` is simply the number of elements in our EBO. Remember, a quad is two triangles, with three vertices per triangle, making six vertices total.
We tell it we're using an unsigned int as the element type (you may have noticed earlier that `indices` was of type `uint[]`). The most commonly used values are `UnsignedInt` and `UnsignedShort`. Some older GPUs only supported `UnsignedShort`, however all modern GPUs can fully support `UnsignedInt`, so this isn't really something you need to worry about anymore.
@@ -529,7 +528,7 @@ The last parameter is a pointer to the starting index of the indices. Since we w
And that's it! Run your program and you should see a lovely orange rectangle on a blue background. Exciting, isn't it... Right...?
-
+
While this may have seen like a lot of set up for a boring result, this code can render pretty much anything you want to the screen. It remains pretty much the same, whether you're rendering a basic quad like this, or a complex 3D model. All you need to change are the vertices & indices going in, and some more complex shader code to handle the transformations.
diff --git a/website/docs/opengl/c1/3-hello-texture.md b/documentation/opengl/c1/3-hello-texture.md
similarity index 90%
rename from website/docs/opengl/c1/3-hello-texture.md
rename to documentation/opengl/c1/3-hello-texture.md
index c012cb7438..142016a784 100644
--- a/website/docs/opengl/c1/3-hello-texture.md
+++ b/documentation/opengl/c1/3-hello-texture.md
@@ -1,19 +1,13 @@
---
-{
- "TableOfContents": {
- "Name": "1.3 - Hello Texture",
- "Url": "3-hello-texture.html",
- "Metadata": {
- "AuthorGitHub": "lumi2021",
- "DateTimeWritten": "11/01/2024 16:00",
- "PreviewImage": ""
- }
- }
-}
+sidebar_position: 3
+sidebar_label: Hello Texture
+slug: 3-hello-texture
---
# 1.3 - Hello Texture
-# Info "You can view the source code for this tutorial [here](../sources/1.3-final-result.html). This tutorial builds on the previous tutorial. If you haven't read it, you can do so [here](1-hello-window.html)." /?>
+
+> [!NOTE]
+> You can view the source code for this tutorial [here](https://github.com/dotnet/Silk.NET/tree/main/examples/CSharp/OpenGL%20Tutorials/Tutorial%201.3%20-%20Hello%20Texture).
In the previous tutorial, we've shown you how to open an OpenGL window and draw a colored quad.
@@ -35,7 +29,8 @@ The most common type of texture is a 2D texture, which stores the 2D grid of pix
as texture objects are a lot more complex than just 2D arrays!
This data is stored in GPU memory, and can be read by a shader.
-# Info "There are multiple different dimensions of texture from 1D through to 3D. For the purposes of this tutorial, we will be focusing on 2D." /?>
+> [!NOTE]
+> There are multiple different dimensions of texture from 1D through to 3D. For the purposes of this tutorial, we will be focusing on 2D.
Textures are quite finicky to setup, and need quite a bit of information in order to be drawn.
The most important piece of information that we need to send to the texture to see it on the screen are the texture coordinates.
@@ -62,7 +57,7 @@ With how we have structured the data, both the vertex and texture coordinates ca
If we try to run our program now...
-
+
Well, that doesn't look like the quad we were expecting. This is because we have updated the vertex buffer we're passing to the vertex shader,
but haven't updated anything else such as our vertex layout definition. Luckily, it's very easy to modify the the example vertex layout
@@ -71,7 +66,7 @@ shown in the previous tutorial to work with our new texture coordinates.
In our `VertexAttribPointer` calls, we declared an `aPosition` attribute with a size of 3 floats and a stride of 12 bytes (`3 * sizeof(float)` equals 12).
Because of this, our buffer is being read like this:
-
+
As you can see, the vertex buffer is being read as if the first vertex was composed of the first three floats in the buffer, then the second
vertex the next three floats, the third vertex the next three, and so on and so forth. However, this is now wrong! Since each
@@ -88,7 +83,7 @@ _gl.VertexAttribPointer(positionLoc, 3, VertexAttribPointerType.Float, false, 5
This will make the buffer be read like this (including the texture coordinate pointer, which we'll add into our code later):
-
+
Now the positions of each vertex are being read correctly! Each position is still three floats, but by skipping the two floats after each position,
we skip over the U and V floats in between each XYZ floats, thus reading them correctly.
@@ -155,7 +150,7 @@ should be incremented before reading the vertex attribute data. This means that
If you do everything right, you will see this result!
-
+
This gives us a nice visualisation of the texture coordinates, but it's not a textured quad. What exactly are we looking at?
What you are seeing is the texture coordinates we passed displayed as a color!
@@ -163,7 +158,7 @@ What you are seeing is the texture coordinates we passed displayed as a color!
The Red, Green and mix between these two colors you see are, respectively, the X and Y texture coordinate values of that pixel.
In the shader, the values are being read like this:
-
+
As you can see, as the X/U coordinate increases so does the amount of red in the output pixel, and likewise as the Y/V coordinate increases so does the amount of green.
Even though we only specified UV values for each vertex, all pixels in the quad have UV values. That's because, as you read before,
@@ -206,8 +201,10 @@ _texture = _gl.GenTexture();
_gl.ActiveTexture(TextureUnit.Texture0);
_gl.BindTexture(TextureTarget.Texture2D, _texture);
```
-# info "Texture units are locations in the OpenGL state where textures can be bound. Instead of textures being specified directly to shader samplers,
-textures are bound to a texture unit, and the texture unit is then specified to the shader sampler." /?>
+
+> [!NOTE]
+> Texture units are locations in the OpenGL state where textures can be bound. Instead of textures being specified directly to shader samplers,
+textures are bound to a texture unit, and the texture unit is then specified to the shader sampler.
After that, we need to load the image. You can do it with the following line:
```cs
@@ -280,7 +277,8 @@ But pay attention! Notice that our texture coordinates are between the ranges of
with normalized values! To better understand this, think about a 250x500 pixels image. If you want to get the pixel at the position
(250, 250), we need to send (250 / width, 250 / height), or (1, 0.5), as the texture coordinate. This way the size of the texture doesn't matter to the shader.
-# Info "You can use the equation ` 1/size * pixel_position ` to get the normalized coordinate for a particlar axis!" /?>
+> [!NOTE]
+> You can use the equation ` 1/size * pixel_position ` to get the normalized coordinate for a particlar axis!
After having configured our uniform `uTexture`, we need to bind our texture unit to it. To do so, we do it using the following lines:
```cs
@@ -309,7 +307,7 @@ With that, the texture in the texture unit 0 should be set for our sampler2D.
And now when you run it (drumroll...), you can see the image being drawn inside the quad!
-
+
## Transparency in OpenGL
Well, you must have noticed the black corners around the texture. If you use another program to check the texture, it's completely transparent! So why isn't it rendering like so?
@@ -337,7 +335,7 @@ If this isn't sufficient, there are a large amount of other blending function co
And when you run the program now, the transparent pixels of the image will not be visible anymore:
-
+
you can see the code final result [clicking here](../sources/1.3-final-result.html).
@@ -362,15 +360,15 @@ Let's see the most common values for these parameters:
#### `TextureWrapMode.Repeat`:
Just repeats the image without any change, turning any coordinates outside the [0, 1) range by taking the fractional part of said number.
-
+
#### `TextureWrapMode.MirroredRepeat`:
Mirror the texture for each 1 texture coordinate unit.
-
+
#### `TextureWrapMode.ClampToEdge`:
Returns the pixel on the respective edge of the image.
-
+
### `TextureMinFilter` & `TextureMagFilter`:
When we draw a texture, the area on the screen in which we're drawing the texture typically doesn't have the same size or shape as the texture. This means that during rendering we
@@ -386,15 +384,16 @@ pixels to the texture coordinates and will return a linear interpolation of them
This is an example from [Learn OpenGL](https://learnopengl.com/Getting-started/Textures). See how the neighbor colors are interpolated to return a different
color:
-
+
#### `Texture(Min/Mag)Filter.Nearest`:
The nearest filter returns the color of the center of the nearest pixel, no interpolation is done.
-
+
-# Info "As `TexParameter` functions don't accepts enuns, you will have to do a explicit convertion using `(int)` in a `TexParameterI`, for integer parameters." /?>
+> [!NOTE]
+> As `TexParameter` functions don't accepts enuns, you will have to do a explicit convertion using `(int)` in a `TexParameterI`, for integer parameters.
## Mipmaps
Now for the last part of this tutorial. Mipmaps are an essential resource for making good renders.
@@ -402,7 +401,7 @@ Now for the last part of this tutorial. Mipmaps are an essential resource for ma
But first, what are Mipmaps?
Mipmaps are a map of tiny versions of the texture. The following is an example of mipmap texture:
-
+
But what is this used for?
@@ -416,7 +415,7 @@ eliminating the moiré effect.
An example from [Wikipedia](https://en.wikipedia.org/wiki/File:Mipmap_Aliasing_Comparison.png). It's possible to notice weird patterns
generated far away in the render without mipmaps:
-
+
But if you think that generating mipmaps by hand for all your textures is really hard work, don't worry! OpenGL provides a special method to
do this for you.
@@ -457,7 +456,7 @@ And now the mipmaps will be used.
## Wrapping up
You've just completed another Silk.NET tutorial! Here are some next steps you can take:
-* Move on to the [next tutorial](../../coming-soon.html), where we'll be abstracting away some of our code to make it easier to read.
+* Move on to the next tutorial, where we'll be abstracting away some of our code to make it easier to read.
* View the full tutorial source code on the [Silk.NET git repository](https://github.com/dotnet/Silk.NET/tree/main/examples/CSharp/OpenGL%20Tutorials/Tutorial%201.3%20-%20Textures).
* Join the [Discord server](https://discord.gg/DTHHXRt), where you can ask questions, show your stuff, and chat with everyone there.
diff --git a/documentation/opengl/index.md b/documentation/opengl/index.md
new file mode 100644
index 0000000000..ed4c6067f6
--- /dev/null
+++ b/documentation/opengl/index.md
@@ -0,0 +1,5 @@
+# OpenGL Tutorials
+
+We're still working on the web, text-based walkthroughs of our example projects. However, the code is already written!
+
+You can check out some examples of using Silk.NET for OpenGL [here](https://github.com/dotnet/Silk.NET/tree/main/examples).
diff --git a/documentation/proposals/(WIP) Proposal - 3.0 Additional math types - Angle.md b/documentation/proposals/(WIP) Proposal - 3.0 Additional math types - Angle.md
new file mode 100644
index 0000000000..375fbc8f96
--- /dev/null
+++ b/documentation/proposals/(WIP) Proposal - 3.0 Additional math types - Angle.md
@@ -0,0 +1,237 @@
+# Summary
+Proposal API for additional math types to bring it up to feature parity with other popular math libraries i.e. `SlimDX`, `SharpDX`, or `Stride3D`. Leveraging modern .NET features such as `INumber` and vectorization.
+
+# Contributors
+- Daniel Keenan (dfkeenan)
+
+# Current Status
+- [x] Proposed
+- [ ] Discussed with API Review Board (ARB)
+- [ ] Approved
+- [ ] Implemented
+
+# Design Decisions
+- This proposal should compliment/augment the proposed 3.0 implementation of `Silk.Net.Maths`, matching `System.Numerics` where possible, with concessions for design oversights in that api.
+- This proposal assumes no knowledge of the 2.x Math library.
+- Text herein marked **INFORMATIVE** does not form a normative part of this proposal, and is for background only.
+- Within this proposal, the key words **must**, **required**, **shall**, **should**, **recommended**, **may**, **could**, and **optional** are to be interpreted as described in [RFC 2119 - Key words for use in RFCs to Indicate Requirement Levels](https://www.ietf.org/rfc/rfc2119.txt). The additional key word **optionally** is an alternate form of **optional**, for use where grammatically appropriate. These key words are highlighted in the proposal for clarity.
+
+
+
+# Proposed API
+
+## Angle
+
+* `IParsable`, `ISpanParsable`, `IUtf8SpanParsable`
+ * must parse angle in degrees using `IParsable`, `ISpanParsable`, `IUtf8SpanParsable`
+ * optional handle `°` character
+
+* `IFormattable`, `IUtf8SpanFormattable`
+ * must produce text in degrees with default format of 2 decimal places. i.e. format string `0.##`
+ * optional include `°` character. i.e. format string `0.##°`
+
+Interface implementations not included for brevity.
+
+```csharp
+///
+/// Represents a unit independant angle using a floating-point
+/// internal representation.
+///
+public readonly struct Angle
+ : IEquatable>
+ , IEqualityOperators,Angle, bool>
+ , IComparable>
+ , IComparisonOperators,Angle, bool>
+ , IAdditionOperators,Angle,Angle>
+ , IDivisionOperators, TScalar, Angle>
+ , IDivisionOperators, Angle>
+ , IMultiplyOperators, TScalar, Angle>
+ , IMultiplyOperators, Angle>
+ , IModulusOperators, Angle, Angle>
+ , ISubtractionOperators,Angle,Angle>
+ , IParsable>
+ , ISpanParsable>
+ , IUtf8SpanParsable>
+ , IFormattable
+ , IUtf8SpanFormattable
+ where TScalar : IFloatingPointIeee754
+{
+ internal Angle(TScalar radians) { }
+
+ /// Angle in degrees in the range [0, 360]. Without fractional component.
+ public TScalar Degrees { get; }
+
+ /// Angle in degrees in the range [0, 360]. With fractional component.
+ public TScalar TotalDegrees { get; }
+
+ /// Angle in radians in range [π, -π].
+ public TScalar Radians { get; }
+
+ /// Angle in radians in range [0, 2π].
+ public TScalar PositiveRadians { get; }
+
+ /// Gets or sets the minutes component of the degrees this Silk.NET.Maths.Angle represents.
+ public TScalar Minutes { get; }
+
+ /// Gets or sets the seconds of the degrees this Silk.NET.Maths.Angle represents.
+ public TScalar Seconds { get; }
+
+
+ ///
+ /// Gets a System.Boolean that determines whether this Silk.NET.Maths.Angle
+ /// is a right angle (i.e. 90° or π/2).
+ ///
+ public bool IsRight { get; }
+
+ ///
+ /// Gets a System.Boolean that determines whether this Silk.NET.Maths.Angle
+ /// is a straight angle (i.e. 180° or π).
+ ///
+ public bool IsStraight { get; }
+
+ ///
+ /// Gets a System.Boolean that determines whether this Silk.NET.Maths.Angle
+ /// is a full rotation angle (i.e. 360° or 2π).
+ ///
+ public bool IsFullRotation { get; }
+
+ ///
+ /// Gets a System.Boolean that determines whether this Silk.NET.Maths.Angle
+ /// is an oblique angle (i.e. is not 90° or a multiple of 90°).
+ ///
+ public bool IsOblique { get; }
+
+ ///
+ /// Gets a System.Boolean that determines whether this Silk.NET.Maths.Angle
+ /// is an acute angle (i.e. less than 90° but greater than 0°).
+ ///
+ public bool IsAcute { get; }
+
+ ///
+ /// Gets a System.Boolean that determines whether this Silk.NET.Maths.Angle
+ /// is an obtuse angle (i.e. greater than 90° but less than 180°).
+ ///
+ public bool IsObtuse { get; }
+
+ ///
+ /// Gets a System.Boolean that determines whether this Silk.NET.Maths.Angle
+ /// is a reflex angle (i.e. greater than 180° but less than 360°).
+ ///
+ public bool IsReflex { get; }
+
+ ///
+ /// Gets a Silk.NET.Maths.Angle instance that complements this angle (i.e. the two angles add to 90°).
+ ///
+ public Angle Complement { get; }
+
+ ///
+ /// Gets a Silk.NET.Maths.Angle instance that supplements this angle (i.e. the two angles add to 180°).
+ ///
+ public Angle Supplement { get; }
+
+ /// Implicit cast in radians
+ public static implicit operator TScalar(Angle angle) => default;
+}
+
+```
+
+
+
+```csharp
+
+public static class Angle
+{
+ public static Angle FromRadians(TScalar radians)
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ public static Angle FromDegrees(TScalar degrees)
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ public static Angle FromDegrees(TScalar degrees, TScalar minutes, TScalar seconds)
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ public static Angle Min(Angle left, Angle right)
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ public static Angle Max(Angle left, Angle right)
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ public static Angle Add(Angle left, Angle right)
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ public static Angle Subtract(Angle left, Angle right)
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ public static Angle Multiply(Angle left, TScalar right)
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ public static Angle Divide(Angle left, TScalar right)
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ public static Angle Clamp(Angle value, Angle min, Angle max)
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ public static Angle Atan2(TScalar y, TScalar x)
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ public static Angle ArcTan(TScalar y, TScalar x)
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ public static Angle ArcSin(TScalar sin)
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ public static Angle ArcCos(TScalar cos)
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ public static Angle Between(in Vector2F left, in Vector2F right)
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ public static Angle Between(in Vector3F left, in Vector3F right)
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ public static Angle ZeroAngle()
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ public static Angle RightAngle()
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ public static Angle StraightAngle()
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ public static Angle FullRotationAngle()
+ where TScalar : IFloatingPointIeee754
+ => default;
+}
+```
+
+# Meeting Agenda/Notes
+## TDB
+* Degrees, minutes and seconds are not fractional. Should they be changed to an integer type (`int`)?
+ * ```csharp
+ public int Degrees { get; }
+ public int Minutes { get; }
+ public int Seconds { get; }
+
+ public static Angle FromDegrees(int degrees, int minutes, int seconds)
+ where TScalar : IFloatingPointIeee754
+ => default;
+ ```
\ No newline at end of file
diff --git a/documentation/proposals/(WIP) Proposal - 3.0 Additional math types - Collision.md b/documentation/proposals/(WIP) Proposal - 3.0 Additional math types - Collision.md
new file mode 100644
index 0000000000..a5d2f094d5
--- /dev/null
+++ b/documentation/proposals/(WIP) Proposal - 3.0 Additional math types - Collision.md
@@ -0,0 +1,280 @@
+# Summary
+Proposal API for additional math types to bring it up to feature parity with other popular math libraries i.e. `SlimDX`, `SharpDX`, or `Stride3D`. Leveraging modern .NET features such as `INumber` and vectorization.
+
+DirectX and other APIs include "collision shapes" that can be used for such things as culling. This proposal covers the addition of similar "Bounding{Shape}" types and their corresponding containment and intersection test.
+
+# Contributors
+- Daniel Keenan (dfkeenan)
+
+# Current Status
+- [x] Proposed
+- [ ] Discussed with API Review Board (ARB)
+- [ ] Approved
+- [ ] Implemented
+
+# Design Decisions
+- This proposal should compliment/augment the proposed 3.0 implementation of `Silk.Net.Maths`, matching `System.Numerics` where possible, with concessions for design oversights in that api.
+- This proposal assumes no knowledge of the 2.x Math library.
+- Text herein marked **INFORMATIVE** does not form a normative part of this proposal, and is for background only.
+- Within this proposal, the key words **must**, **required**, **shall**, **should**, **recommended**, **may**, **could**, and **optional** are to be interpreted as described in [RFC 2119 - Key words for use in RFCs to Indicate Requirement Levels](https://www.ietf.org/rfc/rfc2119.txt). The additional key word **optionally** is an alternate form of **optional**, for use where grammatically appropriate. These key words are highlighted in the proposal for clarity.
+
+# **INFORMATIVE** Integer and Floating Point Types
+While investigating the use of generic math it was decided to provide both an integer and floating point variant for each vector type and every type built from them. See [Generic Math](Proposal%20-%20Generic%20Math.md) proposal for more details.
+
+# I types versus F Types
+Where it is appropriate for a type in this proposal to have both integer and floating point variants they will have a name that ends in I or F, defining whether it is an integer type or floating point type. Integer types **must** use a generic type argument `T` with the constraint of `IBinaryInteger`. On the other hand, floating point types **must** use a generic type argument `T` with the constraint of `IFloatingPointIeee754`.
+
+# Proposed API
+
+`Silk.NET.Math` and the generic math proposal for 3.0 already contain "geometric types" that would be suitable to use for collision/intersection types. i.e. Box3F.
+
+This proposal is to add additional APIs for the purpose of intersection tests.
+
+### PlaneIntersectionType
+
+```csharp
+ public enum PlaneIntersectionType
+ {
+ Back,
+ Front,
+ Intersecting,
+ }
+```
+
+### ContainmentType
+```csharp
+public enum ContainmentType
+{
+ Disjoint,
+ Contains,
+ Intersects,
+}
+```
+
+### IIntersectWithRay
+```csharp
+public interface IIntersectWithRay
+ where TScalar : IFloatingPointIeee754
+{
+ public bool Intersects(ref readonly Ray3F ray);
+
+ public static abstract bool Intersects(ref readonly TSelf shape, ref readonly Ray3F ray);
+
+ public bool Intersects(ref readonly Ray3F ray, out float distance);
+
+ public static abstract bool Intersects(ref readonly TSelf shape, ref readonly Ray3F ray, out float distance);
+
+ public bool Intersects(ref readonly Ray3F ray, out Vector3F point);
+
+ public static abstract bool Intersects(ref readonly TSelf shape, ref readonly Ray3F ray, out Vector3F point);
+}
+```
+
+### IIntersectWithPlane
+```csharp
+public interface IIntersectWithPlane
+ where TScalar : IFloatingPointIeee754
+{
+
+ public PlaneIntersectionType Intersects(ref readonly PlaneF plane);
+ public static abstract PlaneIntersectionType Intersects(ref readonly TSelf shape, ref readonly PlaneF plane);
+}
+```
+
+### IIntersect
+```csharp
+public interface IIntersect
+{
+ public bool Intersects(ref readonly TOther other);
+
+ public static abstract bool Intersects(ref readonly TSelf shape, ref readonly TOther other);
+}
+```
+
+### IContainPoint
+```csharp
+public interface IContainPoint
+ where TScalar : IFloatingPointIeee754
+{
+
+ public ContainmentType Contains(ref readonly Vector3F point);
+
+ public static abstract ContainmentType Contains(ref readonly TSelf shape, ref readonly Vector3F point);
+
+ public ContainmentType Contains(ref readonly Vector3F vertex1, ref readonly Vector3F vertex2, ref readonly Vector3F vertex3);
+
+ public static abstract ContainmentType Contains(ref readonly TSelf shape, ref readonly Vector3F vertex1, ref readonly Vector3F vertex2, ref readonly Vector3F vertex3);
+}
+```
+
+### IContain
+```csharp
+public interface IContain
+{
+ public ContainmentType Contains(ref readonly TOther other);
+
+ public static abstract ContainmentType Contains(ref readonly TSelf shape, ref readonly TOther other);
+}
+```
+
+### IColliderShape
+```csharp
+public interface IColliderShape
+ where TScalar : IFloatingPointIeee754
+{
+ public static abstract TSelf Empty { get; }
+
+ public static abstract void FromPoints(ReadOnlySpan> points, out TSelf result);
+ public static abstract TSelf FromPoints(ReadOnlySpan> points);
+
+ public static abstract void Merge(ref readonly TSelf value1, ref readonly TSelf value2, out TSelf result);
+
+ public static abstract TSelf Merge(TSelf value1, TSelf value2);
+
+ public static abstract void Transform(ref readonly TSelf value, ref readonly Matrix4x4F transform);
+ public static abstract void Transform(ref readonly TSelf value, ref readonly Matrix4x4F transform, out TSelf result);
+}
+```
+
+### BoxF
+
+Additional interfaces/members for BoxF. Interface implementations not included for brevity.
+
+```csharp
+public struct BoxF
+ : IIntersectWithRay, TScalar>
+ , IIntersectWithPlane, TScalar>
+ , IColliderShape, TScalar>
+ , IContainPoint, TScalar>
+ , IIntersect, BoxF>
+ //Implement IIntersect for other shapes
+ , IContain, BoxF>
+ //Implement IContain for other shapes
+ where TScalar: IBinaryFloatingPointIeee754
+{
+
+}
+```
+
+### SphereF
+
+Additional interfaces/members for SphereF. Interface implementations not included for brevity.
+
+```csharp
+public struct SphereF
+ , IIntersectWithRay, TScalar>
+ , IIntersectWithPlane, TScalar>
+ , IColliderShape, TScalar>
+ , IContainPoint, TScalar>
+ , IIntersect, SphereF>
+ //Implement IIntersect for other shapes
+ , IContain, SphereF>
+ //Implement IContain for other shapes
+ , IFormattable
+ where TScalar : IBinaryFloatingPointIeee754
+{
+
+}
+```
+
+### BoxExtentF
+
+Access aligned box for fast frustum culling. Interface implementations not included for brevity.
+
+* Must include the same members as mentioned in the Generic Math proposal in the `Geometric Types` section
+
+```csharp
+public struct BoxExtentF
+ : IEquatable>
+ , IEqualityOperators, BoxExtentF, bool>
+ , IIntersectWithRay, TScalar>
+ , IIntersectWithPlane, TScalar>
+ , IColliderShape, TScalar>
+ , IContainPoint, TScalar>
+ , IIntersect, BoxExtentF>
+ //Implement IIntersect for other shapes
+ , IContain, BoxExtentF>
+ //Implement IContain for other shapes
+ , IFormattable
+ where TScalar : IBinaryFloatingPointIeee754
+{
+ public Vector3F Center;
+ public Vector3F Extents;
+
+ public BoxExtentF(BoxF box);
+ public BoxExtentF(Vector3F minimum, Vector3F maximum);
+
+ public static explicit operator BoxF(BoxExtentF boxExtent);
+ public static explicit operator BoxExtentF(BoxF box)
+}
+
+```
+
+### OrientedBoxF
+
+Box with orientation. Interface implementations not included for brevity.
+
+* Must include the same members as mentioned in the Generic Math proposal in the `Geometric Types` section
+
+```csharp
+public struct OrientedBoxF
+ : IEquatable>
+ , IEqualityOperators, OrientedBoxF, bool>
+ , IIntersectWithRay, TScalar>
+ , IIntersectWithPlane, TScalar>
+ , IColliderShape, TScalar>
+ , IContainPoint, TScalar>
+ , IIntersect, OrientedBoxF>
+ //Implement IIntersect for other shapes
+ , IContain, OrientedBoxF>
+ //Implement IContain for other shapes
+ , IFormattable
+ where TScalar : IBinaryFloatingPointIeee754
+{
+ public Vector3F Center;
+ public Vector3F Extents;
+ public Quaternion Orientation;
+
+ public OrientedBoxF(Vector3F center, Vector3F extents, Quaternion orientation);
+}
+```
+
+### FrustumF
+
+Frustum
+
+```csharp
+public struct FrustumF
+ , IIntersectWithRay, TScalar>
+ , IIntersectWithPlane, TScalar>
+ , IColliderShape, TScalar>
+ , IContainPoint, TScalar>
+ , IIntersect, FrustumF>
+ //Implement IIntersect for other shapes
+ , IContain, FrustumF>
+ //Implement IContain for other shapes
+ , IFormattable
+ , IEquatable>
+ where TScalar : IBinaryFloatingPointIeee754
+{
+ public PlaneF LeftPlane;
+ public PlaneF RightPlane;
+ public PlaneF TopPlane;
+ public PlaneF BottomPlane;
+ public PlaneF NearPlane;
+ public PlaneF FarPlane;
+}
+
+```
+
+```csharp
+public static class Frustum
+{
+ public static FrustumF FromMatrix(Matrix4x4F)
+ where TScalar : IBinaryFloatingPointIeee754
+ => default;
+}
+
+```
+
+# Meeting Agenda/Notes
\ No newline at end of file
diff --git a/documentation/proposals/(WIP) Proposal - 3.0 Additional math types - Color.md b/documentation/proposals/(WIP) Proposal - 3.0 Additional math types - Color.md
new file mode 100644
index 0000000000..9a7e115ebd
--- /dev/null
+++ b/documentation/proposals/(WIP) Proposal - 3.0 Additional math types - Color.md
@@ -0,0 +1,2847 @@
+# Summary
+Proposal API for additional math types to bring it up to feature parity with other popular math libraries i.e. `SlimDX`, `SharpDX`, or `Stride3D`. Leveraging modern .NET features such as `INumber` and vectorization.
+
+This proposal is regarding color type structs.
+
+# Contributors
+- Daniel Keenan (dfkeenan)
+
+# Current Status
+- [x] Proposed
+- [ ] Discussed with API Review Board (ARB)
+- [ ] Approved
+- [ ] Implemented
+
+# Design Decisions
+- This proposal should compliment/augment the proposed 3.0 implementation of `Silk.Net.Maths`, matching `System.Numerics` where possible, with concessions for design oversights in that api.
+- This proposal assumes no knowledge of the 2.x Math library.
+- Text herein marked **INFORMATIVE** does not form a normative part of this proposal, and is for background only.
+- Within this proposal, the key words **must**, **required**, **shall**, **should**, **recommended**, **may**, **could**, and **optional** are to be interpreted as described in [RFC 2119 - Key words for use in RFCs to Indicate Requirement Levels](https://www.ietf.org/rfc/rfc2119.txt). The additional key word **optionally** is an alternate form of **optional**, for use where grammatically appropriate. These key words are highlighted in the proposal for clarity.
+
+# **INFORMATIVE** Integer and Floating Point Types
+While investigating the use of generic math it was decided to provide both an integer and floating point variant for each vector type and every type built from them. See [Generic Math](Proposal%20-%20Generic%20Math.md) proposal for more details.
+
+# I types versus F Types
+Where it is appropriate for a type in this proposal to have both integer and floating point variants they will have a name that ends in I or F, defining whether it is an integer type or floating point type. Integer types **must** use a generic type argument `T` with the constraint of `IBinaryInteger`. On the other hand, floating point types **must** use a generic type argument `T` with the constraint of `IFloatingPointIeee754`.
+
+# Proposed API
+
+### Color
+
+```csharp
+ [StructLayout(LayoutKind.Sequential, Size = 4)]
+ public partial struct Color : IEquatable
+ {
+ public byte R;
+ public byte G;
+ public byte B;
+ public byte A;
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The value that will be assigned to all components.
+ public Color(byte value)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The value that will be assigned to all components.
+ public Color(float value)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The red component of the color.
+ /// The green component of the color.
+ /// The blue component of the color.
+ /// The alpha component of the color.
+ public Color(byte red, byte green, byte blue, byte alpha)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the struct. Alpha is set to 255.
+ ///
+ /// The red component of the color.
+ /// The green component of the color.
+ /// The blue component of the color.
+ public Color(byte red, byte green, byte blue)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The red component of the color.
+ /// The green component of the color.
+ /// The blue component of the color.
+ /// The alpha component of the color.
+ public Color(float red, float green, float blue, float alpha)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the struct. Alpha is set to 255.
+ ///
+ /// The red component of the color.
+ /// The green component of the color.
+ /// The blue component of the color.
+ public Color(float red, float green, float blue)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The red, green, blue, and alpha components of the color.
+ public Color(Vector4F value)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The red, green, and blue components of the color.
+ /// The alpha component of the color.
+ public Color(Vector3F value, float alpha)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the struct. Alpha is set to 255.
+ ///
+ /// The red, green, and blue components of the color.
+ public Color(Vector3F value)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// A packed integer containing all four color components in RGBA order.
+ public Color(uint rgba)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// A packed integer containing all four color components in RGBA order.
+ public Color(int rgba)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The values to assign to the red, green, and blue, alpha components of the color. This must be an array with four elements.
+ /// Thrown when is null.
+ /// Thrown when contains more or less than four elements.
+ public Color(float[] values)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the struct.
+ ///
+ /// The values to assign to the red, green, blue, or alpha components of the color. This must be an array with four elements.
+ /// Thrown when is null.
+ /// Thrown when contains more or less than four elements.
+ public Color(byte[] values)
+ {
+ }
+
+ ///
+ /// Gets or sets the component at the specified index.
+ ///
+ /// The value of the red, green, blue, or alpha component, depending on the index.
+ /// The index of the component to access. Use 0 for the red(R) component, 1 for the green(G) component, 2 for the blue(B) component, and 3 for the alpha(A) component.
+ /// The value of the component at the specified index.
+ /// Thrown when the is out of the range [0, 3].
+ public byte this[int index] { get; set; }
+
+ ///
+ /// Converts the color into a packed integer.
+ ///
+ /// A packed integer containing all four color components.
+ public int ToBgra()
+ => default;
+
+ ///
+ /// Converts the color into a packed integer.
+ ///
+ /// A packed integer containing all four color components.
+ public int ToRgba()
+ => default;
+
+ ///
+ /// Converts the color into a packed integer.
+ ///
+ /// A packed integer containing all four color components.
+ public int ToArgb()
+ => default;
+
+ ///
+ /// Converts the color into a packed integer.
+ ///
+ /// A packed integer containing all four color components.
+ public int ToAbgr()
+ => default;
+
+ ///
+ /// Converts the color into a three component vector.
+ ///
+ /// A three component vector containing the red, green, and blue components of the color.
+ public Vector3F ToVector3()
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ ///
+ /// Converts the color into a three component color.
+ ///
+ /// A three component color containing the red, green, and blue components of the color.
+ public Color3 ToColor3()
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ ///
+ /// Converts the color into a four component vector.
+ ///
+ /// A four component vector containing all four color components.
+ public Vector4F ToVector4()
+ where TScalar : IFloatingPointIeee754
+ => default;
+
+ ///
+ /// Creates an array containing the elements of the color.
+ ///
+ /// A four-element array containing the components of the color in RGBA order.
+ public byte[] ToArray()
+ => default;
+
+ ///
+ /// Gets the brightness.
+ ///
+ /// The Hue-Saturation-Brightness (HSB) saturation for this
+ public float GetBrightness()
+ => default;
+
+ ///
+ /// Gets the hue.
+ ///
+ /// The Hue-Saturation-Brightness (HSB) saturation for this
+ public float GetHue()
+ => default;
+
+ ///
+ /// Gets the saturation.
+ ///
+ /// The Hue-Saturation-Brightness (HSB) saturation for this
+ public float GetSaturation()
+ => default;
+
+ ///
+ /// Adds two colors.
+ ///
+ /// The first color to add.
+ /// The second color to add.
+ /// When the method completes, completes the sum of the two colors.
+ public static void Add(ref readonly Color left, ref readonly Color right, out Color result)
+ {
+ }
+
+ ///
+ /// Adds two colors.
+ ///
+ /// The first color to add.
+ /// The second color to add.
+ /// The sum of the two colors.
+ public static Color Add(Color left, Color right)
+ => default;
+
+ ///
+ /// Subtracts two colors.
+ ///
+ /// The first color to subtract.
+ /// The second color to subtract.
+ /// WHen the method completes, contains the difference of the two colors.
+ public static void Subtract(ref readonly Color left, ref readonly Color right, out Color result)
+ {
+ }
+
+ ///
+ /// Subtracts two colors.
+ ///
+ /// The first color to subtract.
+ /// The second color to subtract
+ /// The difference of the two colors.
+ public static Color Subtract(Color left, Color right)
+ => default;
+
+ ///
+ /// Modulates two colors.
+ ///
+ /// The first color to modulate.
+ /// The second color to modulate.
+ /// When the method completes, contains the modulated color.
+ public static void Modulate(ref readonly Color left, ref readonly Color right, out Color result)
+ {
+ }
+
+ ///
+ /// Modulates two colors.
+ ///
+ /// The first color to modulate.
+ /// The second color to modulate.
+ /// The modulated color.
+ public static Color Modulate(Color left, Color right)
+ => default;
+
+ ///
+ /// Scales a color.
+ ///
+ /// The color to scale.
+ /// The amount by which to scale.
+ /// When the method completes, contains the scaled color.
+ public static void Scale(ref readonly Color value, float scale, out Color result)
+ {
+ }
+
+ ///
+ /// Scales a color.
+ ///
+ /// The color to scale.
+ /// The amount by which to scale.
+ /// The scaled color.
+ public static Color Scale(Color value, float scale)
+ => default;
+
+ ///
+ /// Negates a color.
+ ///
+ /// The color to negate.
+ /// When the method completes, contains the negated color.
+ public static void Negate(ref readonly Color value, out Color result)
+ {
+ }
+
+ ///
+ /// Negates a color.
+ ///
+ /// The color to negate.
+ /// The negated color.
+ public static Color Negate(Color value)
+ => default;
+
+ ///
+ /// Restricts a value to be within a specified range.
+ ///
+ /// The value to clamp.
+ /// The minimum value.
+ /// The maximum value.
+ /// When the method completes, contains the clamped value.
+ public static void Clamp(ref readonly Color value, ref readonly Color min, ref readonly Color max, out Color result)
+ {
+ }
+
+ ///
+ /// Converts the color from a packed BGRA integer.
+ ///
+ /// A packed integer containing all four color components in BGRA order
+ /// A color.
+ public static Color FromBgra(int color)
+ => default;
+
+ ///
+ /// Converts the color from a packed BGRA integer.
+ ///
+ /// A packed integer containing all four color components in BGRA order
+ /// A color.
+ public static Color FromBgra(uint color)
+ => default;
+
+ ///
+ /// Converts the color from a packed ABGR integer.
+ ///
+ /// A packed integer containing all four color components in ABGR order
+ /// A color.
+ public static Color FromAbgr(int color)
+ => default;
+
+ ///
+ /// Converts the color from a packed ABGR integer.
+ ///
+ /// A packed integer containing all four color components in ABGR order
+ /// A color.
+ public static Color FromAbgr(uint color)
+ => default;
+
+ ///
+ /// Converts the color from a packed RGBA integer.
+ ///
+ /// A packed integer containing all four color components in RGBA order
+ /// A color.
+ public static Color FromRgba(int color)
+ => default;
+
+ ///
+ /// Converts the color from a packed RGBA integer.
+ ///
+ /// A packed integer containing all four color components in RGBA order
+ /// A color.
+ public static Color FromRgba(uint color)
+ => default;
+
+ ///
+ /// Restricts a value to be within a specified range.
+ ///
+ /// The value to clamp.
+ /// The minimum value.
+ /// The maximum value.
+ /// The clamped value.
+ public static Color Clamp(Color value, Color min, Color max)
+ => default;
+
+ ///
+ /// Performs a linear interpolation between two colors.
+ ///
+ /// Start color.
+ /// End color.
+ /// Value between 0 and 1 indicating the weight of .
+ /// When the method completes, contains the linear interpolation of the two colors.
+ ///
+ /// Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned.
+ ///
+ public static void Lerp(ref readonly Color start, ref readonly Color end, float amount, out Color result)
+ {
+ }
+
+ ///
+ /// Performs a linear interpolation between two colors.
+ ///
+ /// Start color.
+ /// End color.
+ /// Value between 0 and 1 indicating the weight of .
+ /// The linear interpolation of the two colors.
+ ///
+ /// Passing a value of 0 will cause to be returned; a value of 1 will cause to be returned.
+ ///
+ public static Color Lerp(Color start, Color end, float amount)
+ => default;
+
+ ///
+ /// Performs a cubic interpolation between two colors.
+ ///
+ /// Start color.
+ /// End color.
+ /// Value between 0 and 1 indicating the weight of .
+ /// When the method completes, contains the cubic interpolation of the two colors.
+ public static void SmoothStep(ref readonly Color start, ref readonly Color end, float amount, out Color result)
+ {
+ }
+
+ ///
+ /// Performs a cubic interpolation between two colors.
+ ///
+ /// Start color.
+ /// End color.
+ /// Value between 0 and 1 indicating the weight of .
+ /// The cubic interpolation of the two colors.
+ public static Color SmoothStep(Color start, Color end, float amount)
+ => default;
+
+ ///
+ /// Returns a color containing the smallest components of the specified colors.
+ ///
+ /// The first source color.
+ /// The second source color.
+ /// When the method completes, contains an new color composed of the largest components of the source colors.
+ public static void Max(ref readonly Color left, ref readonly Color right, out Color result)
+ {
+ }
+
+ ///
+ /// Returns a color containing the largest components of the specified colorss.
+ ///
+ /// The first source color.
+ /// The second source color.
+ /// A color containing the largest components of the source colors.
+ public static Color Max(Color left, Color right)
+ => default;
+
+ ///
+ /// Returns a color containing the smallest components of the specified colors.
+ ///
+ /// The first source color.
+ /// The second source color.
+ /// When the method completes, contains an new color composed of the smallest components of the source colors.
+ public static void Min(ref readonly Color left, ref readonly Color right, out Color result)
+ {
+ }
+
+ ///
+ /// Returns a color containing the smallest components of the specified colors.
+ ///
+ /// The first source color.
+ /// The second source color.
+ /// A color containing the smallest components of the source colors.
+ public static Color Min(Color left, Color right)
+ => default;
+
+ ///
+ /// Adjusts the contrast of a color.
+ ///
+ /// The color whose contrast is to be adjusted.
+ /// The amount by which to adjust the contrast.
+ /// When the method completes, contains the adjusted color.
+ public static void AdjustContrast(ref readonly Color value, float contrast, out Color result)
+ {
+ }
+
+ ///
+ /// Adjusts the contrast of a color.
+ ///
+ /// The color whose contrast is to be adjusted.
+ /// The amount by which to adjust the contrast.
+ /// The adjusted color.
+ public static Color AdjustContrast(Color value, float contrast)
+ => default;
+
+ ///
+ /// Adjusts the saturation of a color.
+ ///
+ /// The color whose saturation is to be adjusted.
+ /// The amount by which to adjust the saturation.
+ /// When the method completes, contains the adjusted color.
+ public static void AdjustSaturation(ref readonly Color value, float saturation, out Color result)
+ {
+ }
+
+ ///
+ /// Adjusts the saturation of a color.
+ ///
+ /// The color whose saturation is to be adjusted.
+ /// The amount by which to adjust the saturation.
+ /// The adjusted color.
+ public static Color AdjustSaturation(Color value, float saturation)
+ => default;
+
+ ///
+ /// Adds two colors.
+ ///
+ /// The first color to add.
+ /// The second color to add.
+ /// The sum of the two colors.
+ public static Color operator +(Color left, Color right)
+ => default;
+
+ ///
+ /// Assert a color (return it unchanged).
+ ///
+ /// The color to assert (unchanged).
+ /// The asserted (unchanged) color.
+ public static Color operator +(Color value)
+ => default;
+
+ ///
+ /// Subtracts two colors.
+ ///
+ /// The first color to subtract.
+ /// The second color to subtract.
+ /// The difference of the two colors.
+ public static Color operator -(Color left, Color right)
+ => default;
+
+ ///
+ /// Negates a color.
+ ///
+ /// The color to negate.
+ /// A negated color.
+ public static Color operator -(Color value)
+ => default;
+
+ ///
+ /// Scales a color.
+ ///
+ /// The factor by which to scale the color.
+ /// The color to scale.
+ /// The scaled color.
+ public static Color operator *(float scale, Color value)
+ => default;
+
+ ///
+ /// Scales a color.
+ ///
+ /// The factor by which to scale the color.
+ /// The color to scale.
+ /// The scaled color.
+ public static Color operator *(Color value, float scale)
+ => default;
+
+ ///
+ /// Modulates two colors.
+ ///
+ /// The first color to modulate.
+ /// The second color to modulate.
+ /// The modulated color.
+ public static Color operator *(Color left, Color right)
+ => default;
+
+ ///
+ /// Tests for equality between two objects.
+ ///
+ /// The first value to compare.
+ /// The second value to compare.
+ /// true if has the same value as ; otherwise, false.
+ public static bool operator ==(Color left, Color right)
+ => default;
+
+ ///
+ /// Tests for inequality between two objects.
+ ///
+ /// The first value to compare.
+ /// The second value to compare.
+ /// true if has a different value than ; otherwise, false.
+ public static bool operator !=(Color left, Color right)
+ => default;
+
+ ///
+ /// Performs an explicit conversion from to .
+ ///
+ /// The value.
+ /// The result of the conversion.
+ public static explicit operator Color3(Color value)
+ => default;
+
+ ///
+ /// Performs an explicit conversion from to .
+ ///
+ /// The value.
+ /// The result of the conversion.
+ public static explicit operator Vector3F(Color value)
+ => default;
+
+ ///
+ /// Performs an explicit conversion from