Choppy at first, then smooth

ok guys, let us see what you can do with this one:
I’ve written a 2D game engine in applet form. It works beautifully, pretty good speed, using VolatileImage for the double buffer, good animation code to fill the buffer…etc. the only problem that I have is; When I start animating, it is choppy for about 1~2 seconds, then smooth as a baby’s butt. Now, I can make it smooth at all times by constantly moving the mouse over the applet while I start and stop the animation. Thats right, if I just wiggle the mouse cursor over top of the applet as I use the keyboard to move the characters around everything is totally smooth. Now, I don’t use windows, I use linux. but I get the same results in Mozilla and in Konqueror, so I know it isn’t a browser issue, could be a jvm issue, but I don’t want to accept that. If anyone needs the applet to run in windows to help me out more, I’d be glad to put it up temporarily on a page. but PLEASE try to help me with this, I just can’t find where it is getting this choppiness from, and it is kinda frustrating, thankx in advance!

Thats the normal behavior, because SUN does copy the images on the second paint ( as applet u cant modify this default setting ). U use not hardware accelerated images one the first paint, thats causing the lag, on the second paint image is copied to VRAM ( which also causes some lag)

I’m not sure that I totally understand what you are saying. Is there a way around this? if it works fine when I move the mouse over it, isn’t that something that I could reproduce in code?

I Figured It OUt!!!1
well, I was using the traditional update->paint methodology of applets, so I switched to using the sync() methodology, and now it works like a charm, guess the old awt is totally dead now.:-[ “memories, like the corners of my mind…”

Hey dixoncider, this sounds interresting, what do you mean about sync() methodology?

Could you please refer me to some sources where i can read about it? or show me an example.?

if you search the forums here for info on it, you will find a post that has a gigantic section of code in it, try searching for the word “choppy”. that is how I happened upon it. If you can’t find it, just post reply again, and I’ll see what I can do about getting you some code…

hi
I tried to search but i could not find any info