isn’t there abit of sample code in jbanes’ GAGE lib, that does pretty much exactly that?
It doesn’t have the bouncing Alpha blended sprites… but that isn’t such a problem… um… actually it is LOL
To get the needed render speed on the tiles, you will want the tiles to be managed Images, and be drawn onto a vram surface (BufferStrategy).
Alpha blending being unsupported in hardware, will need to read back from the BufferStrategies vram surface, do the blend, and then copy back.
This will absolutely kill performance.
3 solutions :-
- Render everything using software loops, i.e. keep the tiles, the backbuffer, and the sprites in main memory.
This way, the readback from vram will be avoided, so the alpha blending wont kill the speed.
However, software blitting the tiles will be quite slow, and may prevent you reaching 60fps. (esp. @ 800x600)
-
Relax the requirements, and allow just bitmask transparency on the sprites.
-
Use the experimental D3D full alpha acceleration flags.
Specific to Windows, and even then it won’t work on older gfx cards.
I agree though, Java2D is a mess atm :-/
It is impossible to write an app. that will run at optimal speed on all 3 platforms, with the same code
The hoops you have to jump through to get acceptable performance is crazy IMO.