Hi all, I'm new. I have 4 questions I'd like to ask on this project (which looks great btw): 1) I wa
Hi all, I'm new.
I have 4 questions I'd like to ask on this project (which looks great btw):
1) I was just wondering how fast the Math libraries are in Silk.NET? Do you use any native SIMD/intrinsic library under the hood, or do you rely purely on C#?
2) In the same vein, since I'm working on a Desktop only application, has anyone considered using something like
glm
, or is it too difficult to implement, because I think it's header only? Or do you think it's not worth it? I do see a GlmSharp project.
3) How compatible is Silk.NET with NativeAOT? (I'll be testing this myself anyway, but would be nice to get some info on it.)
4) Are there any parts still not compatible with NativeAOT?
Thanks ahead of time, and thanks for your time!15 Replies
re: 1) https://ptb.discord.com/channels/521092042781229087/607634593201520651/1004400698651320440
2) not really reasonable or worth it really
3) afaik silk.net works fine with aot
Hi, I have the following member variable:
private static GL gl;
However, Visual Studio has an underline on it because it's not initialized in the constructor. Yes, I can add ?
in front, but that would mean I need to write gl!
for every command.
Is there some kind of "dummy" GL context in Silk.NET that I can assign to it, to keep the IDE quiet? eg.
private static GL gl = Silk.NET.OpenGL.GL();
How have others solved this?i believe you can put
gl = null!;
in there
lemme double-check my own codedisable nullable in your csproj file.
= null!;
is the proper solution hereIf I do that, it's project wide.
yep, i remembered correctly,
null!
solves the issue

i very much appreciate the nullability checks .NET has nowadays
not as good as dart, but maybe someday..
i would not want to turn them off for my entire project
Problem with this, I think is that C# is likely to add hidden "is null" checks every time you access the variable.
i thought it was the norm to disable the feature. maybe not then.
it does that no matter what, thats just how the language works
its a ritual of mine to disable global usings and nullable whenever i create a new project.
i hope not
it's a very important warning, imo
By initializing it with a nummy context, I think C# will not add hidden "is null" checks.
i dont believe that is the case, ittl check for null always, since it needs to throw exceptions if it is null