vitek wrote:Multiple scene managers are most definitely supported in C++. It looks like you should be able to do it in C#, but I'm no C# programmer. Does the code you've presented not work? Seems like this should work...
The C# constructor for ISceneManager is
Code: Select all
public ISceneManager( ISceneManager* manager );
but the problem is the pointer. I tried setting Visual Studio Express to allow unsafe code, and placing the "unsafe" keyword in front of my function
Code: Select all
unsafe public void run()
{
//...
}
and then I tried all of the following, but they all refuse to compile:
Code: Select all
ISceneManager scene1 = device.SceneManager;
ISceneManager scene2 = new ISceneManager(scene1);
Error: The best overloaded method match for 'Irrlicht.Scene.ISceneManager.ISceneManager(irr.scene.ISceneManager*)' has some invalid arguments
Code: Select all
ISceneManager* p = device.SceneManager;
ISceneManager scene2 = new ISceneManager(p);
Error: Cannot take the address of, get the size of, or declare a pointer to a managed type ('Irrlicht.Scene.ISceneManager')
Code: Select all
ISceneManager scene1 = device.SceneManager;
ISceneManager scene2 = new ISceneManager(&scene1);
Error: Cannot take the address of, get the size of, or declare a pointer to a managed type ('Irrlicht.Scene.ISceneManager')
I even just saw something about using fixed with pointers in c#
Code: Select all
ISceneManager smgr=device.SceneManager;
fixed (ISceneManager* p = &smgr)
{
ISceneManager s2 = new ISceneManager(p);
}
Still, Error: Cannot take the address of, get the size of, or declare a pointer to a managed type ('Irrlicht.Scene.ISceneManager')
It just looks to me like I'm going to have to go back to C++. The .NET framework is kinda iffy anyway, I suppose, especially since VS.NET Express would require the end-user to have version 2 of the framework.