[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Speed of mouse position capture




On May 15, 2006, at 7:29 AM, Luke Paireepinart wrote:

[snip]
[embarrassed] I don't know how to multi thread. Will try using DirectX,
failing that will investigate multi threading (can you point me to a
good reference?)


I don't know how to use threads very well either.

That's not a problem, because threads will most definitely not solve this problem anyway. Mouse positions are only going to get updated when the event queue is pumped, and besides that you'd lose *more* mouse information by calling get_pos than by inspecting each individual event since it just returns the last mouse position that SDL knows about, rather than each individual event.


In this case, there's nothing you can do except interpolate -- Windows is coalescing some of those events (and I would expect other platforms to do the same). Using a bezier curve to interpolate between mouse positions usually produces something reasonable looking.

-bob