• Advertisement
Sign in to follow this  

UWP DirectX wrapper component - WRL, C++/CX, or C++/WinRT

This topic is 465 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts



I need to implement a simple DirectX wrapper component for an UWP app similar to how Win2D is implemented, but it should be used for rendering and animating 3D models instead. Since I do not have much experience with universal apps, I need guidance about picking the right technology for the task.


After a bit of research, I have found my options are: WRL, C++/CX, and C++/WinRT. To my understanding, WRL is a very low level C++ template library, and implementing even a simple UWP component with it would require a lot of repetitive boilerplate code - something that can be very error-prone, especially for someone with little C++ experience. The C++/CX option seems more tempting at first glance, for someone with mostly C# and Java background, requiring seemingly less boilerplate code, which is more readable and maintainable at the same time. Unfortunately, C++/CX is not strictly C++, but a custom language extension introduced by Microsoft, so my fears are it is less likely to get adequate help from the community when I get stuck with something. Then it comes the fresh new C++/WinRT, which is basically a template library implemented in standard C++, but using certain C++11 and C++14 features to achieve a friendlier API and reduce the boilerplate code needed, in comparison to plain WRL. C++/WinRT is also advertised to generate more efficient code than C++/CX in some cases. Unfortunately, being a preview technology, I am not certain how capable it is of generating complex UWP components.


There is another option - to ditch C++ entirely and go with C# instead, using a wrapper library like SharpDX. The SharpDX option seems tempting as well, considering my C# background and my previous positive experience using it in some desktop applications. The only problem is I am not certain how well SharpDX runs with UWP. The author of the library does not have enough time to fix bugs, so if something goes wrong, I am basically on my own there.


Any advice from someone more experienced in this would be greatly appreciated.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement