SFML community forums

Bindings - other languages => DotNet => Topic started by: raycrasher on May 14, 2013, 07:28:12 am

Title: Why P/Invoke?
Post by: raycrasher on May 14, 2013, 07:28:12 am
I'm just wondering why SFML.NET uses P/Invoke and not a C++/CLI wrapper?

I have read that a custom C++/CLI wrapper gives better performance that using P/Invoke : manual marshalling, coarse interfaces, etc. Especially when using SFML.NET, since there's an additional layer involved (CSFML). I had previous experience wrapping up the libRocket GUI library for use in .NET, and it works great, so it should work for SFML.

Also, a little background: I have been getting weird errors when using the latest version of the .NET binding, so as a result, I'm creating my own C++/CLI wrapper for use in C#. That took care of the errors, and it runs great, but it still needs some work.
Title: Re: Why P/Invoke?
Post by: Laurent on May 14, 2013, 07:48:20 am
Quote
I'm just wondering why SFML.NET uses P/Invoke and not a C++/CLI wrapper?
To make it compatible with Mono (and thus Linux and OS X).

Quote
I have been getting weird errors when using the latest version of the .NET binding
It would be great if you could report them.