Mouse Events

Hello all,

I have a problem with mouse events.
My main thread is in a loop and it pools all events. If there is none, it draws
the scene. The problem is that when I’m displaying a movie from a file, the
mouse movement makes the video jump.
The frames are coming at 50fps, if I don’t draw them, they will be just lost.

Is there a way to keep the mouse event rate low ? Or do I have to use the event
thread ? By the way, how does this thread works ?

I’m trying to find an example. Do i need to create a thread myself and wait
there for events ? Do I need to lock any mutex, and if yes, before or after
WaitEvent ?

Thanks.

wpr

I don’t think the problem is the event handling itself, but rather
your response to the events. If you just throw the mouse events away,
they should have no effect whatsoever on video playback.

Sounds like you’re doing something expensive when handling mouse
events - such as redrawing the pointer and flipping or something.
(Shouldn’t be all that expensive, but if your display isn’t using
hardware page flipping, this is definitely what’s causing the
jumps…)

How about just catching the mouse move events, updating coordinate
variables, and then, when you render each video frame, you apply the
pointer last thing, using those variables? You won’t get the
smoothest possible mouse pointer movement, but it won’t interfere
with the video playback.

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Tuesday 01 March 2005 23.44, Whisper wrote:

Hello all,

I have a problem with mouse events.
My main thread is in a loop and it pools all events. If there is
none, it draws the scene. The problem is that when I’m displaying a
movie from a file, the mouse movement makes the video jump.