cpp_client_telemetry icon indicating copy to clipboard operation
cpp_client_telemetry copied to clipboard

1DS C++ SDK bindings for Unity C# layer

Open maxgolov opened this issue 2 years ago • 4 comments
trafficstars

C# projection layer - old work item #4

It took us a few years to realize that we finally need 1DS C++ SDK bindings for Unity C# code in Microsoft Mesh.

Implementation should work well under the following environments:

  • Unity WebAssembly IL2CPP (Unity transpiles C# to C++ to WebAssembly)
  • Unity Editor with Mono 2.x
  • Unity based on NETStandard 2.x+

List of changes:

  • mod mat.h to pack structure. This enables predictable C API interop between C# layer and C.
  • example that shows how to P/Invoke from .NET to shared 1DS library.

Unity wrapper will be maintained elsewhere outside of this repo.

maxgolov avatar Feb 12 '23 22:02 maxgolov

In case the code under wrappers/netcore is to demonstrate calling capi from C# code using P/Invoke, should we move this code under example directory. The capi related code changes look good in general, though I am not expert on P/Invoke part of example code.

lalitb avatar Mar 02 '23 01:03 lalitb

should we move this code under example directory?

I can split it into two parts:

  • EventNativeAPI.cs - belongs in wrappers dir. This is nearly identical to what we use in the product.
  • Program.cs - belongs in examples dir.

maxgolov avatar Mar 06 '23 22:03 maxgolov

I can split it into two parts:

Yes, that will make sense. Thanks.

lalitb avatar Mar 07 '23 21:03 lalitb

Sorry for delay. We integrated it on our end, so I put it on a back-burner. I'll get back to this.

maxgolov avatar Mar 30 '23 04:03 maxgolov