I check the pen status once per frame of my game. So, while the pen is
down, I:
    get the pen state (EvtGetPen())
    process game stuff
    wait until the next frame time

Now, it turns out that the "wait until next frame" part never does any
waiting, because the EvtGetPen() call ~seems~ to take up so much time.
Perhaps I shouldn't check the pen state every frame? I'll try that.

I notice that neither Race Fever nor Ababall have this problem. Ababall
lets you use the stylus on the Graffiti area or the main screen... no
slowdowns, and a buttery-smooth framerate.

Thanks again for any ideas!


Michael Glickman wrote:

  > Hi WAL,
  >
  > How often do you check the pen status ?
  > Do you just have it in the loop, or use a time-out ?
  >
  > Michael
  >
  >
  > -----Original Message-----
  > From: WAL 9000 [mailto:[EMAIL PROTECTED]]
  > Sent: Saturday, 29 December 2001 9:58 PM
  > To: Palm Developer Forum
  > Subject: My game slows down when the pen is held down
  >
  >
  > Hello,
  >
  > I am writing an action game that allows both pen and key input. However,
  > whenever I hold the stylus down on the screen (or drag it) during the
  > game, the frame rate drops noticeably (from ~10 fps down to 6 or 7). If
  > I drag the pen on the Graffiti area, it drops to something like 2 frames
  > per second!
  >
  > I originally was using PenMoveEvents to track the stylus, but that was
  > even worse than it is now. I currently use a while() loop and
  > EvtGetPen() to track the pen (and process the game loop) after receiving
  > a PenDownEvent.
  >
  > Any tips on where the delays are coming from, and how to get rid of 
them?
  >
  > Thanks in advance for any clues,
  > WAL 9000
  >
  >
  >




-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to