Advertisement

glutMouseMotion

Started by January 27, 2005 11:16 AM
1 comment, last by Flash3r 19 years, 10 months ago
I'm wondering how glutMouseMotion and similar functions that capture input like glutMouseFunc, glutKeyboardFunc work at a low level. For instance if I put a sleep command inside these functions and the thread (i assume it's a thread) is sleeping when something happens, i.e. the mouse moves, do these events get queued and then processed later, or do they get lost forever? What I'm after is I'd like my glutMouseMotion to sample data at a much lower rate then I'm getting because it's just swamping my program at the current rate. I'm sure I could devise a hack, but I was just curious how it all works.
why to use sleep,u can handle it with counter - for example for each 10 mouse event u use only one of them.(counter = (counter+1) % 10; if !counter then use the mouse data).

* if u use sleep it still will be processed but with a delay.
Advertisement
Ok ya that's a good idea. I was just hoping with the sleep I would avoid the movements that happen during the sleep but if it just queues the events then that's no good. Better to just drop them with a method like you said.

Cheers.

This topic is closed to new replies.

Advertisement