Page 1 of 1

FAST image updating

Posted: Fri Jul 16, 2004 9:07 pm
by halo
Please tell me if this is possible before I go and waste a lot of time.

I would like to open a PureBasic window from Blitz3D, and display a full-screen render on it. I would do this by creating a large image, drawing it on the window, and constantly passing pixel data from Blitz to the DLL. Is there any way to write to an image fast enough that this will be feasible? It doesn't have to be super-fast, but shouldn't be less than 20 fps.

I am doing this for a "texture browser" window in a model editor that displays real-time effects on materials.

Posted: Fri Jul 16, 2004 10:57 pm
by Codemonger
it is of course feasible but you should copy memory as a chunk and not per pixel, it's way too slow ... also test rendering in system memory as opposed to video memory. maybe you can change the render target in blitz3d ?

Posted: Fri Jul 16, 2004 11:06 pm
by halo
Okay, let's say I have a point in Blitz where I know the pixel data is stored. Where do I copy this in PB? (Assuming the pixel format is the same!!!)

Posted: Fri Jul 16, 2004 11:47 pm
by Codemonger
Good question ? thats where it gets complex .. you might be better off doing some sort of screen capture from purebasic ... this may slow things down but at least will capture it in a format u can use easily.

But if you are adventureous I believe Fred has placed some PB internal structures in the PureBasic libraries descritor file (located in the Library SDK file) . You'll have to play around a bit, use peek and poke lots and memory commands. :lol: Tons of Fun !

Posted: Sat Jul 17, 2004 12:51 am
by halo
Okay, I do that all the time in Blitz.