Rendering Performance Issues

My fps dropped by around 250 frames when using your method as compared to just drawImage.

I pretty much answered this in my previous post on this thread (bearing in mind that BufferStrategy is most likely using VolatileImage)

Now you have. Before you didn’t mention that BufferStrategy most likely uses a VolatileImage.

My method wasn’t intended to be used every frame. It’s just a quick way to copy pixels from one image to another, without dealing with volatile images / video memory / etc.

You’ve changed your questions so many times that I’m no longer really sure what your current problem is or what you’re trying to accomplish…

What seems to be the problem here??

[quote]I’m trying to do pixel-by-pixel rendering to an image using for loops. I have an int array where pixel data is written to, and then, once per frame, that array is rendered to the BufferedImage.
[/quote]

BufferedImage image = new BufferedImage(WIDTH, HEIGHT,
			BufferedImage.TYPE_INT_RGB);
	int[] pixels = ((DataBufferInt) image.getRaster().getDataBuffer())
			.getData();
BufferStrategy s = getBufferStrategy();
		if (s == null) {
			createBufferStrategy(2);
		}

		for (int i = 0; i < pixels.length; i++) {
			pixels[i] = i + (int)System.currentTimeMilllis();
		}

                drawImageAt(10, 20, someImage);

		Graphics g = bs.getDrawGraphics();
		g.drawImage(image, 0, 0, null);
		g.dispose();
		bs.show();
public void drawImageAt(int x, int y, BufferedImage img) {
    int[] pixies = img.getRGB(0,0, img.getWidth(), img.getHeight(), null, 0, img.getWidth() );
    
    for (int yy = 0; yy < img.getHeight(); yy++) {
       for (int xx = 0 ; xx < img.getWidth(); xx++) {
           pixels[ (y+yy) * image.getWidth() + x + xx ] = pixies[y*img.getWidth() + x];
}
}
}

This statement doesn’t mean anything else than ‘it got slower’.

If the framerate dropped from 2500fps to 2250fps, that means it took 0.04ms
If the framerate dropped from 300fps to 50fps, that means it took 16.67ms