My question is about Timers and Graphics2D.
The problem is that my games should run ok on Linux, Windows and Mac.
With Ubuntu GF5200FX + FireFox -> my game demo runs with set 25 or 26 fps, all ok here where i build my program.
With Ubuntu GF5200FX + Opera or Konqueror -> the same game demo runs 4-8 fps.
With WINXP GF5200FX + with all browsers -> same demo, frame rate goes steadyly with 20-22 fps, still not 26 fps, what i set it to run.
With my friend, at his home WINXP GF8800GTS computer the frame rate goes wild between 0-25 fps, and he says it was unplayable.
I have following build with my code ->
- CANVAS on APPLET
- BUFFERSTRATEGY (2) on CANVAS
- BUFFERSTRATEGY (2) with RENDERINGHINTS
g2d.setRenderingHint( RenderingHints.KEY_RENDERING , RenderingHints.VALUE_RENDER_QUALITY );
g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING , RenderingHints.VALUE_ANTIALIAS_ON );
g2d.setRenderingHint( RenderingHints.KEY_INTERPOLATION , RenderingHints.VALUE_INTERPOLATION_BILINEAR );
g2d.setRenderingHint( RenderingHints.KEY_ALPHA_INTERPOLATION , RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY );
g2d.setRenderingHint( RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON );
COMPATIBLEBUFFEREDIMAGES varying from largest size 1024x256 to smallest 64x64.
My Timer class. ( build with -> System.currentTimeMillis(); )
getTime () - returns 1.000 second accurated timer runtime.
Reset () - resets to 0.000
setTime () - set time to needed, 1.000 second accurated.
Im not very experienced with Java, and my school experience to computer programming is totally null.
still i would like to get forward with my hobby.
so, my question is for my problem with Timer and Graphics2D.
there is no bugs on my code. i simply use the technology SUN offers. why my game demo is so different with every soft/hardware setup i try.
what are all the things i need to take care, when i want my games to run on every soft/hardware setups about the same speed.
my demo -> http://temp4321.dy.fi/Pelit/