www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: hytparadisee on June 20, 2007, 08:56:48 am

Title: How to use the int[] version of FrameBuffer.blit()
Post by: hytparadisee on June 20, 2007, 08:56:48 am
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
Title: Re: How to use the int[] version of FrameBuffer.blit()
Post by: EgonOlsen on June 20, 2007, 06:07:08 pm
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!