Aaron, thanks for help! It works perfect now!

Tony

"Aaron Ardiri" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> > I have design an timing critical application that having a time bar
dropping
> > every 250ms, so I used
> >
> > EvtGetEvent(&event, SysTicksPerSecond() / 4)
> >
> > at my EventLoop routine and handled the dropping of time bar at
nilEvent, it
> > works fine on PalmOS 3.x and 4.x, but having problem on Zire 71, the
time
> > bar drops very fast. Please help!
>
> tony, you cannot rely on this.
>
> EvtGetEvent() uses the second parameter to say:
>
>   "well, if nothing happened by this time, send me a nilEvent"
>
> there are many circumstances where the OS/3rd party applications can
> force extra nilEvents to happen, you need to get smart about this
> and use something like:
>
> myTimeOutMax = SysTicksPerSecond() / 4;
> myTimeOut    = 1;
> myTimeA      = TimGetTicks()
> do
> {
>    EvtGetEvent(&event, myTimeOut)
>    myTimeB = TimGetTicks();
>
>    if (event.eType == nilEvent)
>    {
>      if ((myTimeB - myTimeA) > myTimeOutMax)
>      {
>        myTimeA = TimGetTicks();
>
>        // handle nil event
>      }
>    }
>
>    myTimeOut = (myTimeOutMax - (myTimeB - myTimeA));
>    if (myTimeOut < 0) myTimeOut = 0;
>  }
>  ...
>
> NOTE: this is tested code (i have it in every one of my games), its
>       just i typed it in from memory just as i woke up (ie: now),
>       the concept is there - figure it out.
>
> ---
> Aaron Ardiri                        [EMAIL PROTECTED]
> CEO - CTO                                           +46 70 656 1143
> Mobile Wizardry                      http://www.mobilewizardry.com/
>
>
>
>



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

Reply via email to