nanogui: set a timer when move the window!
Subject:
Re: [nanogui] set a timer when move the window!
From:
Justin Fretwell ####@####.####
Date:
19 Aug 2002 09:39:09 -0000
Message-Id: <200208190923.JAA16097@hamster.akhter.com>
guys,
PLEASE use plain text when sending these in! as a linux user only i cant
read half of what you are saying.
On Monday 19 Aug 2002 10:17 am, Alex Holden wrote:
> wang wrote:
> > In nanowm, dragging window is not efficient,in former
> >maillist ,Alex suggested use a timer to reduce the
> >number of GrMoveWindow().now I implement this ,yes,it's
> >agiler than it did,and even I set the timer to 1ms ,
> >it should be better.
>
> You know that's 1000Hz right? 1/10th of that, 100Hz (10ms) is faster
> than the eye can see and even 50Hz (20ms) ought to be fine.
>
> > wm_timer=GrCreateTimer(window->wid,1,1);
> >wm_tiemr is a globe variable ,so GrDetroyTimer() can use.
>
> I'd put in a bit of sanity checking here. Initialise Wm_timer to 0, only
> create the timer if it is 0, only destroy the timer if it is not 0, and
> set it to 0 after destroying it. Also do a final GrMoveWindow() on
> button up to make sure you don't miss the last position event when the
> button is released. You could also make it slightly more efficient by
> recording the last position you moved the window to and if it has not
> changed since the last timer event, don't do the GrMoveWindow() call.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####