Re: [AD] mouse state variables and poll_mouse |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: Re: [AD] mouse state variables and poll_mouse
- From: Chris <chris.kcat@xxxxxxxxxx>
- Date: Tue, 11 Jan 2005 05:48:32 -0800
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=YdmPy2zCTeW0efUwYZPynh69wHhtTms3mgv154SmoG9CAi0xkBRzn+H0jSVtEW90rgH+OH4OqDqSDn+jF1cT7sVO6Iybns1DK/cpxk1YwJVdt3QyuGWicwMkigTUqwl/KfktIvh4YNQWmsch9O9+pKk16N0PswPF5y4hs0VqOo4=
Marcio Afonso Arimura Fialho wrote:
Besides the scenario given by Evert, reverting back to
assyncronous mode could save some calls to
poll_mouse();
You shouldn't need to call poll_mouse, ever, as long as the system
doesn't need it. And if the system does need it, there's no way to get
away from polling.
(eg., if the programmer wishes to offer to the
user of his game the possibility of setting back and
forth between assyncronous and polling mode).
I'd think uninstalling and reinstalling the mouse would be enough for
that, wouldn't it?
By the way, why does Allegro offers an assyncronous
mouse state update? Isn't the polling mode alone
enough?
Asynchronous was first (used by DOS, which AFAIK, updated the mouse vars
from the hardware (system called) interrupt), and polling was added
later "just in case". IMO, you should never poll unless needed.
Hopefully future versions of Allegro can add block-until-event updating
(start a thread and do a blocking call to read input events, which will
(should) put the thread completely to sleep until an event occurs.. no
looping or background polling necessary).