LLGL icon indicating copy to clipboard operation
LLGL copied to clipboard

Is C# wrapper cross-platform?

Open elgunhuseynli opened this issue 4 years ago • 2 comments

It seems like current C# wrapper using C++/CLI. (Correct me if I'm wrong) Isn't C++/CLI only supported on Windows platform for now? Microsoft introduced C++/CLI support to .NET Core 3 but unfortunately it is only working on Windows.

PInvoke is the only option right now for cross-platform C# binding.

elgunhuseynli avatar Jan 23 '20 09:01 elgunhuseynli

Hi, I'm afraid you're right. I barely used C# on other platform other than Windows except a few times with Mono but no C/C++ bindings. If you can refer me to some good references for portable C++ to C# bindings, let me know.

LukasBanana avatar Jan 24 '20 02:01 LukasBanana

https://github.com/microsoft/CsWinRT

mediabuff avatar Dec 19 '20 13:12 mediabuff

With the new C API, it will be easy to use this from C# now :)

jayrulez avatar Aug 02 '23 16:08 jayrulez

@jayrulez wouldn't that still require to also declare all enums and structs in C#, though?

LukasBanana avatar Aug 03 '23 01:08 LukasBanana

Yes, that's still necessary but this is what everyone does anyway. Take a look at the bgfx bindings as an example: https://github.com/bkaradzic/bgfx/blob/master/bindings/cs/bgfx.cs

jayrulez avatar Aug 03 '23 04:08 jayrulez

Better late than never, but this is resolved with 8e00be1. It also includes two C# examples that are no longer using C++/CLI.

LukasBanana avatar Nov 06 '23 00:11 LukasBanana