I wanted to try out Silk.NET without a console application. I like to use Polyglot Notebooks / .NET Interactive for quick iteration and prototyping. I got a System.PlatformNotSupportedException instead (Silk.NET works in Console Apps, however).
Steps to reproduce
Platform: Desktop, Apple M2
Framework Version: .NET 8
API: not sure, I guess OpenGL
Requirements: VS Code with the Polyglot Notebooks Extension installed
My script is the following, inside a Polyglot Notebook Cell:
#r "nuget: Silk.NET"
using Silk.NET.Windowing;
var window =
Window.Create(
WindowOptions.Default
);
window.Run();
Again, the same code snippet would work in a Console App.
I am sure this can be resolved by just referencing the right dependency, I haven't yet found out which one or where to locate it.
full error message:
Error: System.PlatformNotSupportedException: Couldn't find a suitable window platform. (GlfwPlatform - not applicable, SdlPlatform - not applicable) https://dotnet.github.io/Silk.NET/docs/hlu/troubleshooting.html
at Silk.NET.Windowing.Window.Create(WindowOptions options)
at Submission#6.<>d__0.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.RunSubmissionsAsync[TResult](ImmutableArray1 precedingExecutors, Func2 currentExecutor, StrongBox1 exceptionHolderOpt, Func2 catchExceptionOpt, CancellationToken cancellationToken)
Summary
I wanted to try out Silk.NET without a console application. I like to use Polyglot Notebooks / .NET Interactive for quick iteration and prototyping. I got a System.PlatformNotSupportedException instead (Silk.NET works in Console Apps, however).
Steps to reproduce
Requirements: VS Code with the Polyglot Notebooks Extension installed
My script is the following, inside a Polyglot Notebook Cell:
Again, the same code snippet would work in a Console App.
I am sure this can be resolved by just referencing the right dependency, I haven't yet found out which one or where to locate it.
full error message: Error: System.PlatformNotSupportedException: Couldn't find a suitable window platform. (GlfwPlatform - not applicable, SdlPlatform - not applicable) https://dotnet.github.io/Silk.NET/docs/hlu/troubleshooting.html at Silk.NET.Windowing.Window.Create(WindowOptions options) at Submission#6.<>d__0.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.RunSubmissionsAsync[TResult](ImmutableArray
1 precedingExecutors, Func
2 currentExecutor, StrongBox1 exceptionHolderOpt, Func
2 catchExceptionOpt, CancellationToken cancellationToken)