Skip to content

Commit

Permalink
Update GlfwWindowing.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Perksey authored Sep 27, 2023
1 parent 123c522 commit c6e531e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Windowing/Silk.NET.Windowing.Glfw/GlfwWindowing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,20 @@ public static class GlfwWindowing
{
public static void RegisterPlatform()
{
Window.Add(new GlfwPlatform());
if (Window.GetOrDefault<GlfwPlatform>() is null)
{
Window.Add(new GlfwPlatform());
}
}

/// <summary>
/// Prioritizes the GLFW windowing platform over others.
/// </summary>
public static void Use() => Window.PrioritizeGlfw();
public static void Use()
{
RegisterPlatform(); // may not be done by reflection on NativeAOT
Window.PrioritizeGlfw();
}

/// <summary>
/// Gets a value indicating whether the given view is a GLFW view.
Expand Down

0 comments on commit c6e531e

Please sign in to comment.