DiligentGraphics / DiligentCore

A modern cross-platform low-level graphics API
http://diligentgraphics.com/diligent-engine/
Apache License 2.0
594 stars 130 forks source link

Dot NET tasks #424

Open TheMostDiligent opened 11 months ago

TheMostDiligent commented 11 months ago
rbnpontes commented 9 months ago

Will Diligent .NET support binaries to Linux ?

MikhailGorobets commented 9 months ago

Will Diligent .NET support binaries to Linux ?

I don't plan to do that at the moment, user demand for the nuget package is not high. To support the Linux version I need to put a lot of effort into modifying SharpGenTools

Alan-FGR commented 8 months ago

Why do you need to modify SharpGenTools to support Linux? Shouldn't the bindings be cross platform?

MikhailGorobets commented 8 months ago

Why do you need to modify SharpGenTools to support Linux? Shouldn't the bindings be cross platform?

Both native dll and dll with managed code differ from platform to platform. So we need to add a feature that selects which dll folder should be used depending on the OS used, like it is done for selecting dlls depending on the processor architecture.

Alan-FGR commented 8 months ago

Thanks for the reply. What would be different in the managed code besides perhaps call convention though? (and bug workarounds like unmanaged delegates)

MikhailGorobets commented 8 months ago

Thanks for the reply. What would be different in the managed code besides perhaps call convention though? (and bug workarounds like unmanaged delegates)

NativeWindow is typedef to platform specific window handle. This is used to initialize ISwapChain https://github.com/DiligentGraphics/DiligentCore/blob/master/Platforms/interface/NativeWindow.h

MikhailGorobets commented 8 months ago

@Alan-FGR If you really need a Linux version of the package, you can do the following:

Alan-FGR commented 8 months ago

@MikhailGorobets thank you so much for your support!

I'm actually not currently in need of of Linux support. I was just curious on what would prevent the bindings from being cross platform as tbh that's the reason I'm considering it.

From what you said it doesn't sound too hard. Later today I'll see if I can get it to work on Wasm and maybe bflat as well.

Does SharpGenTools not generate a C layer on top of the C++ code?

Also, do you plan to support DiligentFX? I was thinking of using that native "model" type and cal the more higher level stuff.

MikhailGorobets commented 8 months ago

@Alan-FGR The code generated by SharpGenTools uses a pointer to the vtable of the corresponding COM object, and by offset, we invoke the corresponding method. It does not generate any additional unmanaged code for interop. DiligentFX currently does not have a COM interface, so it is not possible to create C# bindings for it at the moment.