such as a text file, and would appreciate any help.
Edit: After some searching, i found http://www.ogre3d.org/addonforums/viewtopic.php?f=8&t=10413 where he had the same (unsolved) problem,
And http://www.ogre3d.org/addonforums/viewtopic.php?f=8&p=21661#p21661, which had the solution
In a nutshell, here it is:
- Code: Select all
//DataStreamPtr dataPtr = ResourceGroupManager.Singleton.OpenResource("my resource");
public MemoryStream DataPtrToStream(DataStreamPtr dataPtr)
if (dataPtr.Size() != 0)
byte buffer = new byte[dataPtr.Size()];
//Get the pointer to the first element of our buffer of bytes (in C++, can just use 'buffer')
fixed (byte* bufferPtr = &buffer)
//Read buffer.Length amount of data into bufferPtr
MemoryStream stream = new MemoryStream(buffer);
Thanks to bekas and Madmark for coming up with the above method, I just sort of put it together.