Uno-Platform: OpenGL in cross platform app

Viewed 936

Does anyone know if there is a way to embed an OpenGL view in an Uno-Platform app? I need it to work across iOS, macOS, Android and UWP. I have a lot of C# / Xamarin code I'd like to reuse.

1 Answers

There is no universal implementation of OpenGL for all platforms. Some does not support it at all...

  • Android: You may use the Android.Opengl namespace
  • iOS: You may use GLKit
  • macOS: You may use NSOpenGLView BUT IT IS DEPRECATED (Apple is suggestion to use MetalKit instead)
  • Wasm: You need to use WebGL, a subset of OpenGL.
  • Windows: A popular way is to use GTK3
  • Linux: A popular way is to use GTK3

Right now, the only universal API available for graphic rendering with Uno Platform is SKIA. I don't know if it suits your case, but here's a Uno sample running SKIA on multiple platforms: https://github.com/unoplatform/Uno.Samples/tree/master/UI/SkiaSharpTest

Related