Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UWP support for opengl

guys. I have a opengl library written in c++. I know that I can use Angle but because of this I will need to code in C++ my whole app. Is there a way to use c++ opengl in UWP and still use C# as a main language?

like image 993
Rustam Ibragimov Avatar asked Oct 09 '16 13:10

Rustam Ibragimov


1 Answers

Is there a way to use c++ opengl in UWP and still use C# as a main language?

ANGLE is currently the only way to get the OpenGL API to run in UWP. For more details please reference this thread.

You can write your own via interop if you want to use ANGLE from c#. You can also write your low level OpenGL stuff in C++ and wrapper it. Then invoke it by C# in your logic level.

Fortunately, people who have the same requirements as you created an issue on the GitHub a few days ago, and got samples from @mattleibow. @mattleibow shared his code in this thread. For more details, please reference OpenGL surface from SwapChainPanel declared in XAML in C#.

Additionally, ANGLE is actually for translating OpenGL ES to DirectX. So I recommend you to use Win2D instead. Win2D is a new, immediate mode 2D drawing framework for XAML applications on Windows 8.1 and Windows 10. It is built on the high performance foundation of DirectX, but is designed to provide the convenience and ease of use expected by C# and .NET developers. More details you can reference this video.

like image 158
Sunteen Wu Avatar answered Sep 27 '22 20:09

Sunteen Wu