|
get_mouse_mickeys() and OS X |
Ben Moreno
Member #7,725
September 2006
|
I've been working on a project that uses Allegro 4.2-svn (svn is needed for intel Mac support) and OpenLayer (and thus AllegroGL and the other OpenLayer support libraries). Everything works fine on Windows and Linux (except for the fact that I have to rest(0) before calling get_mouse_mickeys() on Linux for some odd reason). However, on OS X, only the first call to get_mouse_mickeys() sets the arguments to something other than 0. After the fist call, mickeyx and mickeyy are always set to 0. I am curently using OS X 10.4.7 and Xcode (FWIW, I've also used gcc on the command line as well) to build the project. I have tried the lastest (as of yesterday) SVN of Allegro. Oddly, the exmouse program seems to work perfectly. My project is fullscreen, so that may be part of the problem. Everything other than get_mouse_mickeys() seems to be working. I have tried calling poll_mouse() before get_mouse_mickeys, but that doesn't make a difference. If anyone has any ideas, it would be greatly appreciated. Thanks, |
Evert
Member #794
November 2000
|
Quote: except for the fact that I have to rest(0) before calling get_mouse_mickeys() on Linux for some odd reason That's weird. You're not using the hardware cursor, are you? Quote: Oddly, the exmouse program seems to work perfectly.
That's even stranger. Quote: I have tried calling poll_mouse() before get_mouse_mickeys, but that doesn't make a difference. Nah, it wouldn't. We should probably deprecate poll_mouse() at some point to tell people that it's a rather useless function... |
Richard Phipps
Member #1,632
November 2001
|
Is get_mouse_mickeys being called twice in the main loop? That would zero the 2nd call.. |
Peter Hull
Member #1,136
March 2001
|
Mmm.
Works fine, but if I replace the rest(50) with rest(0), it always returns zero as reported. I'll have a look. Pete
|
Richard Phipps
Member #1,632
November 2001
|
So a temporary solution would be to only call the rest(0) if the OS is linux? |
Peter Hull
Member #1,136
March 2001
|
Actually, I'm wrong, it only appears to always return zero. New program (attached)
How does this work for you, Ben? Otherwise I have a simple patch to use floats internally when calculating the mickeys, attached. Can you try it, if the program above doesn't work. Pete
|
Richard Phipps
Member #1,632
November 2001
|
Is it possible that the rest(0) is causing the process to switch to the OS and back again and that is destroying the old mouse data? |
Ben Moreno
Member #7,725
September 2006
|
I tried the code you posted, it seems to work correctly. The problem doesn't appear to be rest(0) - I've tried running the program with rest() commented out. I'll try the patch, though, to see if that helps. Thanks for helping. |
|