Performance problems with Graphics

Hi there!

I have written a little game with java2 using Image-class for offscreen buffering. The application is running in a Frame.

Problem: As soon as I put in any graphics, like drawImage(...), in Windows XP, performance slowed down a lot. I have about 1fps!. Then I put the application in Windows 95 compatibility mode and it runs a lot faster. But now, as soon as I use the menu bar of the window, slowing down starts again, when I quit using the menu, things are fast again.

Can anyone help me?

Thanks a lot!

[560 byte] By [BrunoChilian] at [2007-9-30 10:37:31]
# 1

Try posting some of the code (particularly the paint() method).

I had a similar problem (not sure if it was XP) in an applet.

I put some System.out.println commands in the update and paint methods and found that each repaint call caused several calls to update and paint (sometimes over 30!) which slowed down the processing a lot!

I fixed it by adding some code into the update function which ignored calls if update had been called within the last x milliseconds.

It worth a look.

Alastair.

ALASTAIR at 2007-7-3 19:38:18 > top of Java-index,Administration Tools,Sun Connection...
# 2
P.S. don't forget the [ code ] [ /code ] tags for code.
ALASTAIR at 2007-7-3 19:38:18 > top of Java-index,Administration Tools,Sun Connection...
# 3
hiThank you for your help. nice comment. keep the work! aff dan http://www.work-at-home-profits.com
blandonnet at 2007-7-3 19:38:18 > top of Java-index,Administration Tools,Sun Connection...