From: Allan R. <ar...@pa...> - 2012-03-30 20:13:19
|
Hello Folks, I have written a small portable GLUT package that works on Linux, Windows & Mac OS. For the Linux platforms, I am using the Freeglut implementation. I am now working on a capability based on the mouse movement and have found a difference in the behavior between Freeglut & GLUT and an trying to find a work around. Unfortunately, the callback I have for the glutMotionFunc has some time consuming work to do (at least with respect to the mouse movement) and gets behind as more movement events are queued. This results in very slow response, as well as continued processing after the movement has stopped. The same code run with the GLUT package does not exhibit this behavior. It appears that GLUT is throwing out all events received while processing the first one. While I do not get as smooth an effect, I do get much better response to the mouse position. Is there some way to to flush or ignore these extra events while I am responding to the first one? I have tried turning off the glutMontionFunc (setting the callback routine to NULL) while handling the callback, but this does not help. I can think of elaborate ways to do this, but I was hoping of something a bit simpler (preferably a couple of API calls). I am using a few different Linux distros, multiple verions of Red Hat enterprise versions as well as OpenSUSE. The Freeglut versions also run the gambit for an old 2.2 to the current 2.8. All seem to share this behavior. Thanks, Allan |