glutMouseMotion
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.
* if u use sleep it still will be processed but with a delay.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement