Re: [AD] Should al_set_mouse_xy generate events?

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Sat, 2009-02-28 at 19:01 +0100, Anders Andersson wrote:
> As I'm currently using this function for infinite movement. I have an
> inside perspective.
> I think that when you use the function you should get a mouse axes
> event just like you had moved the mouse there.
> In my program I just ignore that event by checking if the event I got
> is pointing to the coordinates I set.
> 
> People may want to use that mouse axes event, I think it's unnecesary
> to do anything special. Possibly you may add a flag in the event.
> 

Checking the position means you will not get smooth movement.

Assume the mouse is warped to x = 100, and the user moves the mouse 10
pixel to the right, then 10 pixel to the left. So Allegro's event queue
contains movement events like this:

event 1: e.x = 110; e.dx = 10;
event 2: e.x = 100; e.dx = -10;

In your game, you now ignore the second event completely, as if the user
never moved the mouse to the left. Players of the game really will hate
you :P

-- 
Elias Pschernig <elias@xxxxxxxxxx>





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/