I know, I’m going back to this subject again
I see a post by BurntPizza when searching on google about the bufferedimage which dated back to 2012
so lets say you set up this:
BufferedImage img = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
int[] pixels = ((DataBufferInt) img.getRaster().getDataBuffer()).getData();
then you create the packed interger (which is what ive learnt and understood from this forum)
public static int pack(int r, int g, int b) {
//clamp to range [0, 255]
if (r < 0)
r = 0;
else if (r > 255) r = 255;
if (g < 0)
g = 0;
else if (g > 255) g = 255;
if (b < 0)
b = 0;
else if (b > 255) b = 255;
//pack it together
return (255 << 24) | (r << 16) | (g << 8) | (b);
}
then you can unpack it or whatever
But… with setting the pixels to be manipulated, how would I then go about creating shapes to use in an update method?
Also one last Q, what benefit does this have adding / import seperate PNG type sprites into this?
I’m finding it difficult this last few months with this bufferedimage thing, and its something I wana get to terms with — and yes, I do use OpenGL so no engine thing here please
Thanks peeps!!