I am working on a Java 2D video game, and developing it on Mac OS X 10.10.1. I am trying to do this all using the Java 2D api, and avoiding 3rd party libraries. I seem to be having display update issues, where sometimes things update very fast, then sometimes things seem to be sputtering along as if hesitant to update.
From reading other peoples comments with regard to Java 2D performance, I switched all my graphic images over to use of VolatileImage, and for any graphics that are not dynamic, I perform offscreen and copy to the screen invocation by invocation within my paintComponent routine (which is driven off a timer). And these images are created as VolatileImage as well.
I have noticed this jerky screen behavior after I made these performance enhancements (i.e. VolatileImages and offScreen drawing buffers). Now, the reason I made these changes is to take advantage of hardware acceleration. How can I check if this is occurring? And, any ideas on how to correct this jerky screen update issue I now have going on? I have seen people talk about use of dynamic timers, that would recalculate how long to wait for next update, given actual time spent on current update, to attempt to get smoothly updated graphic movements. Is this the way to do it? Or am I missing something?
Thanks.