We're developing very similar applications for Windows and Android using Xamarin platform and C#. Both will incorporate some on-screen and off-screen 3D rendering, such as 3D mesh visualization.
We'd like to implement this as cross-platform as possible. How is this usually done in Xamarin? Is it better to do rendering in C++ code, or is there a C# wrapper with abstractions over platform-specific context creation etc.?
After some time I can answer my own question.
At least in my case it turned out to be more convenient to use OpenGL from C++. We just built a shared library from C++ code and link it to .NET dll's using DllImport.
Our tool for building C++ libraries is CMake, however you can use other build systems, such as new features of VS2015.
One particular benefit of this solution is that you can reuse this code anywhere else: in iOS application, desktop application for Windows, Mac, Linux, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With