I have googled and youtubed. But, I learn much easier from this forum so here we go…
My last post I asked about animation which I’ve near enough cracked to the point I can code from scratch a JFrame and do some bouncing balls etc…
I’ve been struggling and confused for a while now with this BufferedImage thing, I’ve been watching tutorials and there is many on java game programming on youtube as you may all know. But when it gets passed setting up the fps counter loop, basic setup engine, screen etc and gets onto the bufferedImage and pixel thing I’m lost and like I say I have to been googling but still dont get it. Things like:
var = ((DataBufferByte) m_displayImage.getRaster().getDataBuffer()).getData();
and…
private BufferedImage image = new BufferedImage(WIDTH, HEIGHT,
BufferedImage.TYPE_INT_RGB);
At the moment Im guessing it creates a blank image onto the canvas but obviously theres more to it? Why do they setup a pixel array when you could add sprites with Image? Eventually though I’ll be wanting to draw sprites with code like they do on Java4K I’m always mentioning on my posts, I’m in no competion about this I just find it fasinating using pure Java so no replys on other game engines please.
If you could enlighten me on this subject so I can understand it better that would be excellent…