Re: [AD] minor fix

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


Elias Pschernig wrote:

while (read(joy_fd[i], &e, sizeof(struct js_event)) == sizeof(struct js_event))

The above means, if the joystick sends too much data - it will just hang
the Allegro program. OTOH, if the program is too slow to receive all
joystick input - there's a problem anyway. I don't have a joystick
myself to test it, and at least someone finds the new behavior better -
so I'd vote for applying it, and then see if linux programs start
behaving bad with joystick enabled.


If we want to be on the safe side, can't we just put an upper limit on the number of events to process every frame ? For example, stop processing events when there is none left, of when we processed 100 of them. This makes the joystick more responsive, and prevents hanging.

--
Julien Cugnière




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