tags:

views:

61

answers:

1

1) Is their any performance loss when making a new image with bitmask transparency, drawing just a few things on it then drawing it on top of another; versus drawing the same image in the same conditions, but with the background cleared to an opaque color ?

2) What is the importance of the performance loss when drawing multiple images versus drawing one big image that includes them all ?

3) Is it better to draw small bit of images from a big image (a sprite sheet) or from their individual image ? Note I'm speaking about memory images, their representation on disk doesn't matter.

+1  A: 

There are a lot of unknown parameters here:

  • What is the underlying OS
  • What is the JVM vendor/version
  • How much memory is available on the video card
  • How big is the image
  • Is the image hardware accelerated

The only practical way to answer your questions is to run benchmarks.

Guillaume
- I'm interested about Windows and Linux- The last version of Sun's JDK- The thing should run on old machines without video card, so it's also not hardware accelerated (GraphicsDevice.getAvailableAcceleratedMemory() = 0).For the size of the image, consider drawing a 500x500 image versus drawing 100 50x50 images.
Norswap
Well, like I said there will be a lot going on. You should test your application and see if it's good enough. Initially try to make things as simple as possible because the underlying implementation already has smart optimizations.
Guillaume