I have been creating a graphical library for another game engine in C#. It uses only basic dot net functionality such as System.Math and System.Collections. It returns an array of bytes as an image.
I was thinking that I would also like to port it to the Unreal engine. Since it could be used to make procedural textures.
So is there some easy way I can port this library to work with Unreal? Or will it be a case of using search and replace to edit the file to make it into a C library?
I’m in the process of porting over a C# game prototype into UE4 and C++. The process is mostly a matter of translating C# code and all the library calls into C++ with UE4 engine calls. There’s no easy way to do it, at least for me. The good news about porting code is that most of the logic has already been taken care of, so it goes a lot faster than rewriting it all from scratch.
You could create a C++ wrapper around your .NET code using a mix of unmanaged and managed C++. If you make your unmanaged C++ code accessible through a Windows .DLL file, you could probably import those into your game C++ code.
Interesting. The library doesn’t call any other functions except Math functions so if I could quickly make a wrapper and test it with Unreal that would be nice. Calling some functions and getting a byte array back to use as a texture. I’m wondering if the wrapper method builds the virtual machine into the library or would the game then only work on PCs with dot net virtual machine installed?
When using the current .NET platform, the user will indeed need to have .NET installed. Microsoft .NET Native that you linked seems to compile to self-contained native executables. Sounds like fun!