Marek Wyszynski wrote:
> I'm porting a shooting game to PalmOS 5. My game requires constant
> high frame rates (>30fps). Now I'm facing a serious problem with
> pen events. When I tap the screen and hold pen down my framerate
> falls down 30%-50%! Since in my game I need to be able to control
> the ship using pen this is a big problem for me.
>
> I tried to catch penDownEvent/penUpEvent/penMoveEvent in my event
> loop and not let the system to process them but it does not rally
> make any difference.

One possible solution is to process the pen by using EvtGetPen()
in a loop instead of letting the system give you separate events
for each little movement.  Like this:

        case penDownEvent:
                if (PenInShipControlArea())
                {
                        Coord penx, peny;
                        Boolean pendown;

                        EvtGetPen (& penx, & peny, & pendown);
                        while (pendown)
                        {
                                ControlShip (penx, peny);

                                EvtGetPen (& penx, & peny, & pendown);
                        }
                }

                break;

That's a little simplistic because you may need to do other
stuff to advance the state of the game other than just
moving the ship, but you get the general idea.

  - Logan

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

Reply via email to