S
Silk.NET12mo ago
Dade

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
khitiara
khitiara12mo ago
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
Dade
DadeOP12mo ago
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?
TechnicJelle
TechnicJelle12mo ago
i believe you can put gl = null!; in there lemme double-check my own code
Aqua
Aqua12mo ago
disable nullable in your csproj file.
Lyris the Kitori
Lyris the Kitori12mo ago
= null!; is the proper solution here
Dade
DadeOP12mo ago
If I do that, it's project wide.
TechnicJelle
TechnicJelle12mo ago
yep, i remembered correctly, null! solves the issue
No description
No description
TechnicJelle
TechnicJelle12mo ago
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
Dade
DadeOP12mo ago
Problem with this, I think is that C# is likely to add hidden "is null" checks every time you access the variable.
Aqua
Aqua12mo ago
i thought it was the norm to disable the feature. maybe not then.
Lyris the Kitori
Lyris the Kitori12mo ago
it does that no matter what, thats just how the language works
Aqua
Aqua12mo ago
its a ritual of mine to disable global usings and nullable whenever i create a new project.
TechnicJelle
TechnicJelle12mo ago
i hope not it's a very important warning, imo
Dade
DadeOP12mo ago
By initializing it with a nummy context, I think C# will not add hidden "is null" checks.
Lyris the Kitori
Lyris the Kitori12mo ago
i dont believe that is the case, ittl check for null always, since it needs to throw exceptions if it is null

Did you find this page helpful?