Hi,
I want to create a program in C#, using the Irrlicht engine. Is this possible, and if so, can anyone teach me how to set up VisualStudio.Net to do this?
Thanks
C#
This will propably not so easy as you wished it were.
The problem is that the irrlicht.dll is an unmanaged C++ dll (and not an COM object). This means that you can't use it natively, of course, but you can also - as it is no COM object - not access it via COM object interoperation. Platform invocation services (with which you can get access to unmanaged WIN32 dlls) won't help you much, either, as the irrlicht.dll does not only contain C functions but mainly C++ classes.
The easiest approach would probably be the following: Build a small C++ managed assembly that mirrors the structure of the Irrlicht classes (or at least the classes you need), include the Irrlicht library as unmanaged code and pass all calls of your mirrored managed classes directly to the unmanaged Irrlicht functions. Then you can use this assembly in C#.
Of course this would give you an additional layer of overhead (and the need to do some C++), but I don't see any other solution besides reimplementing Irrlicht in C# using managed DirectX (which would be an interesting project, as I'd like to know if the .NET corner guys are right when they claim that managed DirectX allows nearly the same performance as usual DirectX).
The problem is that the irrlicht.dll is an unmanaged C++ dll (and not an COM object). This means that you can't use it natively, of course, but you can also - as it is no COM object - not access it via COM object interoperation. Platform invocation services (with which you can get access to unmanaged WIN32 dlls) won't help you much, either, as the irrlicht.dll does not only contain C functions but mainly C++ classes.
The easiest approach would probably be the following: Build a small C++ managed assembly that mirrors the structure of the Irrlicht classes (or at least the classes you need), include the Irrlicht library as unmanaged code and pass all calls of your mirrored managed classes directly to the unmanaged Irrlicht functions. Then you can use this assembly in C#.
Of course this would give you an additional layer of overhead (and the need to do some C++), but I don't see any other solution besides reimplementing Irrlicht in C# using managed DirectX (which would be an interesting project, as I'd like to know if the .NET corner guys are right when they claim that managed DirectX allows nearly the same performance as usual DirectX).
Some time ago, I thought about writing a small wrapper with managed code for making Irrlicht available for .NET languages like C#, VB.Net, and so on, especially because I like C# very much. But it would be really a lot work, and it does not really make sence now, because Irrlicht's interface will change a lot until it's way to 1.0, I fear. But maybe someone would like to do this job, I would appreciate it.
-
- Posts: 2
- Joined: Tue Nov 25, 2003 12:27 pm
- Location: Cologne, Germany