views:

124

answers:

1

I'm making a game in java and in used BufferedImages to render content to the screen. I had performance issues on low end machines where the game is supposed to run, so I switched to VolatileImage which are normally faster. Except they actually slow the whole thing down.

The images are created with GraphicsConfiguration.createCompatibleVolatileImage(...) and are drawn to the screen with Graphics.drawImage(...) (follow link to see which one specifically). They are drawn upon a Canvas using double buffering.

Does someone has an idea of what is going wrong here ?

+2  A: 

Most likely your code is mixing accelerated and unaccelerated operations.

This document is a must read. Section 3.2 in particular is essential for anyone working with accelerated Java graphics.

Devon_C_Miller
Is it possible that scaling (in the sense of clipping, see link in the question) an image is such an unaccelerated operation ? Since I use sprite sheets, every draw must effectively select a part of the image to draw to the screen.
Norswap