ImageBuffer() equivalent?
BlitzMax Forums/BlitzMax Programming/ImageBuffer() equivalent?
| ||
Sorry if this has been covered by something else, but I've done a search and can't find anything. I am wondering how / if it is possible to perform drawing commands such as DrawRect and DrawText upon a separate image (or pixmap), as was possible in Blitz2D using SetBuffer(ImageBuffer(MyImage))? I'm trying to create a very basic GUI engine and would like to render each gadget as an image before drawing it, as it just seems more efficient that way - or would doing the individual draw commands be just as good? |
| ||
The easiest way would be to draw your images to the backbuffer, as normal, and then use GrabImage() to turn it into an image. As long as your clear the screen and don't use Flip, the user will be none the wiser. |
| ||
JazzieB. yeah, but thats slooooooooooooooooooooooooooooooooooooooooooooooooooooooooooow...... |
| ||
I agree it could be slow if this was being done every game/app update loop, but I generally use it to generate images internally, so would only be using it at the beginning of my game and nowhere else - so wouldn't be a problem. Sounds like Prospero is doing something similar, so may work just as well for their project. |
| ||
thats ok as long as the backbuffer is bigger than the image, what do we do if we need to acces an imagebuffer > screen?!? |
| ||
What does the > mean? You can't access image buffers, in realtime, you have to manually copy pixel over unless you use Indiepaths render2texture which is the only way to draw to textures (which images are) in realtime. |
| ||
What does the > mean? Greater than. Meaning an imagebuffer larger than the screen. I guess. |
| ||
there was a module released that allowed this....from the same people that did the glowing lines thing. |
| ||
Indiepath.r2t, yes Not available anymore as people trashed his mailbox with support questions although the code was "as is". |
| ||
Your wrong, Dreamora! It's still there : http://www.blitzbasic.com/Community/posts.php?topic=60428 ... and you've seen this thread ?! :O cheers |
| ||
Ah you are right, that thread still exists. (didn't think of it anymore) But the download with the source and the license isn't online anymore, so we actually don't know what "License: Indiepath License for non warranted software" means. |
| ||
Indiepath module forums |
| ||
Cool, they are up again? :-) |