How to use the int[] version of FrameBuffer.blit()

Started by hytparadisee, June 20, 2007, 08:56:48 AM

Previous topic - Next topic

hytparadisee

I need a short example, because all my attempts end up with either an array out of bounds exception or a "Blitting region out of bounds" Error
Today I finally found a problem to my soluuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuution

EgonOlsen

The array has to be x*y in size to store a bitmap with x columns and y rows. That's basically the whole trick. It's difficult to give an example of this, because it's really pretty straight forward. You can take (for example) an int[] returned by a PixelGrabber from an image.
Keep in mind that using this method in hardware requires a texture upload every time => slowness!