Hi, friends !
Sorry for my English ...
I notice strange behaviour of MIDlet when use GameCanvas. I write a game and have two version - for MIDP 1.0 using Canvas and for MIDP 2.0 using GameCanvas (just for full screen).
Main game loop work in separate thread.
In MIDP 2.0 version (with GameCanvas) I have notice strange game slowdown (firstly I create a MIDP 1.0 version). Reaction on keyborda events is very slow, game update became very twitched (it is noticed by scrolling game screen).
Just for insure I rewrite MIDP 2.0 version using Canvas instead GameCanvas and my game became good - all work perfectly.
Then I return to GameCanvas and find that:
a) if I insert Thread.sleep(10) into main loop (notice - it work in separate Thread) then my FPS down, but game work more smoothly, reaction on keyboard and update is ok.
b) If I use just Thread.yield() (even 2-3 times in a loop step) then no any changes - work bad. (for compare - for version with Canvas enough one Thread.yield() per loop step)
Is anybody know what is it and how have workaround ?
Thanks in advance !