PInvoke vs CLI wrapper, C++ functionality to C#

122 views Asked by At

I was wondering what the best to choose is. Let's say I want to use C++ functions from C#. In most of the cases Platform Invoke will do the job fairly simple. The problem is that I want to wrap functions that are critical (used many times a second) i.e. OpenGL draw calls. This implies that there would be latency and loss in performance due to the intermediate layer. Then I found about CLI which is basically managed C++. I thought it would be faster, but since PInvoke is a technology improved for years, it be better.

What is actually the best performance-wise solution to use C++ functionality in C#/.Net

Edit: What are the pros and cons of both?

0

There are 0 answers