Removed…
Do you have a game loop? If so, are you using a fixed timestep or a variable timestep?
Removed…
No I believe sleep(4) is enough to max out your CPU since your loop is being run 250FPS
Removed…
What does myTimer.getTime() return? I’m assuming it returns the time in seconds since the last call reset? Measuring time in milliseconds or nanoseconds is more recommended.
Anyway, how many images are you drawing? I ran this on my computer:
-0 images, 0-5% CPU
-5 images, 10-5% CPU
-20 images, 20-25% CPU
Jari: DO you have intel graphics card? How much cpu game link at my signature uses?
Removed…
If you have any scaled or rotated images and/or non binary alpha values, even with opengl=true, java2d can fall back to a software renderer. This is very very slow even with just a few images. Even on really fast hardware. The other case where things can get really slow and things hit a software fallback is when the image format is not the same as the graphics device format. Again even if opengl=true.
Finally i don’t think opengl=true will work for applets anyway. Or will at least be somewhat unreliable. Oh and as said before, A FX5200 is really old and slow. It is more than 5 years old, like older than dual core and 64bits and all that.
Problem is somewhere at your computer. 4 year old cheap laptop can run my game lot faster than 2fps so I think there is nothing problem with your code it’s just combination of Java graphics and your computer.
Removed…
Works fine on my computer: Windows 7 x64 integrated Intel graphics card