Perhaps I'm doing something I'm not supposed to...
But I've found that trying to load textures in two separate streams will often cause one of the texture loads to fail.
Here's the error that I get:
05-27-2008 11:03:20 | TEXTURE MANAGER : Couldn't find the texture file ##MEMORY:22633444|59015.
The work around is pretty easy...
1 - Don't load textures in two separate threads at the same time.
Or
2 - Given this situation, where bmpPage is a System.Drawing.Bitmap (.net):
Dim stream As New System.IO.MemoryStream
Dim buffer() As Byte
bmpPage.Save(stream, System.Drawing.Imaging.ImageFormat.Png)
buffer = stream.ToArray()
Dim pointer As IntPtr = System.Runtime.InteropServices.Marshal.UnsafeAddrOfPinnedArrayElement(buffer, 0)
Dim datasource As String = Globals.GetDataSourceFromMemory(pointer.ToInt32, buffer.Length)
Just keep retrying this line in a loop until the _TexID doesn't equal zero.
_TexID = TextureFactory.LoadTexture(datasource, "webpage", Engine.WebSizeX, Engine.WebSizeY, MTV3D65.CONST_TV_COLORKEY.TV_COLORKEY_NO, True) ' MTV3D65.CONST_TV_COLORKEY.TV_COLORKEY_BLACK)