Skip to content

Commit 5816b63

Browse files
committed
Fixes from self review
1 parent 52153ab commit 5816b63

File tree

7 files changed

+11
-57
lines changed

7 files changed

+11
-57
lines changed

.github/workflows/dotnet.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ jobs:
2626
uses: actions/setup-dotnet@v3
2727
with:
2828
dotnet-version: '9.0.x'
29-
#dotnet-quality: 'preview'
29+
dotnet-quality: 'preview'
3030
- name: Install Workloads
31-
run: |
32-
dotnet workload restore
33-
dotnet nuget locals all --clear
31+
run: dotnet workload restore
3432
- name: Pack
3533
# TODO decide whether we want experimental builds to use Debug or Release - using Release for now...
3634
run: >-
@@ -80,12 +78,10 @@ jobs:
8078
- name: Setup .NET
8179
uses: actions/setup-dotnet@v3
8280
with:
83-
dotnet-version: '9.0.102'
84-
#dotnet-quality: 'preview'
81+
dotnet-version: '8.0.x'
82+
dotnet-quality: 'preview'
8583
- name: Install Workloads
86-
run: |
87-
dotnet workload restore
88-
dotnet nuget locals all --clear
84+
run: dotnet workload restore
8985
- name: Restore
9086
run: dotnet restore --runtime ${{ matrix.rid }}
9187
- name: Test

Silk.NET.sln

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Windowing", "Windowing", "{
102102
EndProject
103103
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Windowing", "sources\Windowing\Windowing\Silk.NET.Windowing.csproj", "{EF07CBB5-D253-4CA9-A5DA-8B3DF2B0DF8E}"
104104
EndProject
105-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.Core.Analyzers", "sources\Core\Analyzers\Silk.NET.Core.Analyzers.csproj", "{D672DD5F-6A43-421B-92EB-1D1FFB7C1FFC}"
106-
EndProject
107105
Global
108106
GlobalSection(SolutionConfigurationPlatforms) = preSolution
109107
Debug|Any CPU = Debug|Any CPU
@@ -170,10 +168,6 @@ Global
170168
{EF07CBB5-D253-4CA9-A5DA-8B3DF2B0DF8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
171169
{EF07CBB5-D253-4CA9-A5DA-8B3DF2B0DF8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
172170
{EF07CBB5-D253-4CA9-A5DA-8B3DF2B0DF8E}.Release|Any CPU.Build.0 = Release|Any CPU
173-
{D672DD5F-6A43-421B-92EB-1D1FFB7C1FFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
174-
{D672DD5F-6A43-421B-92EB-1D1FFB7C1FFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
175-
{D672DD5F-6A43-421B-92EB-1D1FFB7C1FFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
176-
{D672DD5F-6A43-421B-92EB-1D1FFB7C1FFC}.Release|Any CPU.Build.0 = Release|Any CPU
177171
EndGlobalSection
178172
GlobalSection(SolutionProperties) = preSolution
179173
HideSolutionNode = FALSE
@@ -206,7 +200,6 @@ Global
206200
{F16C0AB9-DE7E-4C09-9EE9-DAA8B8E935A6} = {EC4D7B06-D277-4411-BD7B-71A6D37683F0}
207201
{FE4414F8-5370-445D-9F24-C3AD3223F299} = {DD29EA8F-B1A6-45AA-8D2E-B38DA56D9EF6}
208202
{EF07CBB5-D253-4CA9-A5DA-8B3DF2B0DF8E} = {FE4414F8-5370-445D-9F24-C3AD3223F299}
209-
{D672DD5F-6A43-421B-92EB-1D1FFB7C1FFC} = {5CD096DB-6C44-48F1-9093-AD4C84B6B7EC}
210203
EndGlobalSection
211204
GlobalSection(ExtensibilityGlobals) = postSolution
212205
SolutionGuid = {78D2CF6A-60A1-43E3-837B-00B73C9DA384}

docs/for-contributors/README.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/for-contributors/Windowing/future-improvements.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ determined that this work was simply out-of-scope for the initial 3.0 release as
99
from having a lower-level API was determined to not be a requirement for the initial release, and was not included in
1010
the original Working Group approved software development plan.
1111

12-
To ensure that such a lower-level API could be developed in the future, the `ISurfaceProvider` interface has been added,
13-
the idea being that this would be implemented (possible by a default interface method) by the low-level API and there
14-
would just be a common `Surface<TBackend>` returned by `ISurfaceProvider.Create` where `TBackend` is an implementation
15-
of the low-level API. The `ITypeChain` type was also introduced to ensure we could have extensible configuration for
16-
this model as well, so everything should be in place for us to investigate this in a minor release.
17-
1812
We're well aware this sounds very similar to what our friends at OpenTK are planning for 5.0, for much of the same
1913
reasons. Indeed we still have community members who are also OpenTK community members that were advocating for it for
2014
this reason. It's great to consider this sort of prior art, the sharing of insights and lifting eachother up is what

sources/Core/Analyzers/Silk.NET.Core.Analyzers.csproj

Lines changed: 0 additions & 19 deletions
This file was deleted.

sources/OpenGL/OpenGL/ContextSourceExtensions.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
using System.Runtime.CompilerServices;
5+
46
namespace Silk.NET.OpenGL;
57

68
public static class ContextSourceExtensions
79
{
10+
private static ConditionalWeakTable<IGLContext, IGL> _cwt = new();
11+
812
public static IGL CreateOpenGL(this IGLContextSource src)
913
{
1014
if (src.GLContext is not { } ctx)
@@ -20,9 +24,8 @@ public static IGL CreateOpenGL(this IGLContextSource src)
2024

2125
public static IGL CreateOpenGL(this IGLContext ctx) => GL.Create(ctx);
2226

23-
public static void MakeCurrent(this IGLContextSource src) =>
24-
GL.ThisThread.MakeCurrent(src.CreateOpenGL());
27+
public static void MakeCurrent(this IGLContextSource src) => src.GLContext?.MakeCurrent();
2528

2629
public static void MakeCurrent(this IGLContext ctx) =>
27-
GL.ThisThread.MakeCurrent(ctx.CreateOpenGL());
30+
GL.ThisThread.MakeCurrent(_cwt.GetValue(ctx, c => c.CreateOpenGL()));
2831
}

sources/Windowing/Windowing/Silk.NET.Windowing.csproj

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,13 @@
66
<TargetFrameworks Condition="'$(SilkiOSDisabled)' != 'true'">$(TargetFrameworks);net8.0-ios;net9.0-ios</TargetFrameworks>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>
9-
<NoWarn>0067</NoWarn> <!-- TODO -->
109
</PropertyGroup>
1110

1211
<ItemGroup>
1312
<ProjectReference Include="..\..\Core\Core\Silk.NET.Core.csproj" />
1413
<ProjectReference Include="..\..\Maths\Maths\Silk.NET.Maths.csproj" />
1514
<ProjectReference Include="..\..\SDL\SDL\Silk.NET.SDL.csproj" />
1615
</ItemGroup>
17-
18-
<ItemGroup>
19-
<ProjectReference Include="..\..\Core\Analyzers\Silk.NET.Core.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
20-
</ItemGroup>
2116
<Import Project="..\..\Core\Core\Silk.NET.Core.targets" />
2217

2318
</Project>

0 commit comments

Comments
 (0)