Pass a bitmap to TV3D Engine
BlitzMax Forums/BlitzMax Programming/Pass a bitmap to TV3D Engine
| ||
Hi ! I want to manipulate a bitmap with bmax and pass it to TV3D engine, but how I can do ? In C# I use à memory string, that a translate into an array of byte, and I past this pointer to a TV3D function... Someone have an idea ? Nicolas |
| ||
I replied to this last night but apparently it went into the great beyond with all the server junk. Load it as a pixmap, then use TVGlobals.GetDataSourceFromMemory() with the pointer to the pixmap and the size of the pixmap. Should work fine. |
| ||
Can you give me an exemple please thank |
| ||
I can't give you a proper example at the moment, but off the top of my head : Local Image:TPixmap=CreatePixmap(512,512,PF_RGBA8888) ' DO STUFF WITH IMAGE Local Tex:Int = TVTextureFactory.LoadTexture(TVGlobals.GetDataSourceFromMemory(Int(PixMapPixelPtr(Image)),4*PixMapWidth(Image)*PixMapHeight(Image)),"MemoryTexture") I'm not positive if that will work, because I'm not positive if the way pixmaps are stored is equivalent to a BMP format image or not. The TVGlobals.GetDataSource() bit is definitely correct. Ideally, TV expects you to use the DX9 Internals class to do this sort of thing, but this is not available with BlitzMax, I'm afraid. It's the one part of the SDK I can't wrap. At least, I don't think I can. But hopefully that will work. |
| ||
It doesn't work ... :-( So the last solution, it's to past by the hardisk ... Nicolas |
| ||
If it is pure DX9 you might not even need to wrap it. Pub.DirectX includes DirectX9 interfaces up to some degree ... |
| ||
You know what? You might be right. I'll have to have a closer look at it again. My main concern at the time of starting the module was not to force everyone who wanted to compile it themselves to have the DX9 SDK installed, but since most people don't seem to be doing that, perhaps it's not such a bad idea. I'll put it on my to do list and see how I go anyway. |