My apologies in advance - this is a cross post from the Irrlicht.NET CP forum, not the official Irrlicht.NET port. I'm desperate for help!! I posted two messages over there tonight, here they are:
I need to be able to create a texture in memory and apply that to a material in Irrlicht. The C++ version of Irrlicht has IVideoDriver::createImageFromData, which looks like it's exactly what I need. However, I'm using Irrlicht.NET CP and it doesn't look like that function is part of the wrapper. Is there any way to do what I'm after in Irrlicht.NET CP? This is super, super urgent!! Any help would be very appreciated.
Well here's a status update... I've been trying to add that function to the wrapper but haven't been successful. I keep getting a System.EntryPointNotFoundException. I've never done any p-invoke stuff before so I'm not sure if there's something I'm missing. I've tried every different function signature I could think of but still no luck. My most recent version looks like this:
Assuming I have the function signature right, is there anything more that I need to do? I've only been building Irrlicht.NET.dll and Irrlicht.Extensions.dll and have not touched my original copies of Irrlicht.dll and IrrlichtW.dll.Code: Select all
public Image CreateImageFromData(ColorFormat fmt, Dimension2D size, IntPtr data) { return (Image) NativeElement.GetObject(VideoDriver_CreateImageFromData(_raw, fmt, size.ToUnmanaged(), data, false), typeof(Image)); } [DllImport(Native.Dll)] static extern IntPtr VideoDriver_CreateImageFromData(IntPtr videodriver, ColorFormat fmt, int[] size, IntPtr data, bool ownForeignMemory);
Thanks,
bigfish