×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2005
    Posts
    5

    Strange MIDlet slowdown when use GameCanvas instead Canvas

    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 !

  2. #2
    Regular Contributor
    Join Date
    Sep 2004
    Location
    Barcelona, Spain
    Posts
    68
    I have exactly the same problem. I've done a sprite walking over a map and it is very very slow. Any clue on where is the problem?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×