Aleksei Petrenko
Aleksei Petrenko

Reputation: 7178

Cross-platform OpenGL rendering in Xamarin

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.?

Upvotes: 5

Views: 3703

Answers (1)

Aleksei Petrenko
Aleksei Petrenko

Reputation: 7178

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.

Upvotes: 2

Related Questions