Re: [AD] Should al_set_mouse_xy generate events? |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: "Coordination of admins/developers of the game programming library Allegro" <alleg-developers@xxxxxxxxxx>
- Subject: Re: [AD] Should al_set_mouse_xy generate events?
- From: "Trent Gamblin" <trent@xxxxxxxxxx>
- Date: Sat, 28 Feb 2009 10:29:34 -0700 (MST)
On Sat, February 28, 2009 10:17 am, Elias Pschernig said:
> A) Add a field event.mouse.was_set to ALLEGRO_MOUSE_EVENT. If this field
> is true, the movement came from al_set_mouse_xy and is not a real user
> movement. Now dx/dy from only user events can be used in the game for
> perfectly smooth movement.
>
> B) Do not generate any mouse events for al_set_mouse_xy in the first
> place. This also can prevent a "feedback loop" where a user does
> something foolish like calling al_set_mouse_xy(event.mouse.x + 1, 0) in
> response to each mouse movement event...
>
> I have a very slight preference for B.
Well for one thing, the user always knows when they call
al_set_mouse_xy, so technically they don't need an event
anyway. It might be less convenient in some circumstances
is all.
Trent :{)>