Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#72 joystick is ignored if no other timers are set

closed-accepted
moderate (59)
5
2005-05-26
2005-05-23
Dan Torop
No

Revision 1.116 of freeglut_main.c seems to have
introduced a bug: Windows which read the joystick but
do not have an active timer or idle function will not
necessarily get joystick events at the poll interval
requested in glutJoystickFunc().

A fix of this bug is:

--- freeglut/src/freeglut_main.c.orig 2005-05-23
02:31:36.000000000 -0400
+++ freeglut/src/freeglut_main.c 2005-05-23
02:31:51.000000000 -0400
@@ -462,7 +462,7 @@
msec = fghNextTimer( );
/* XXX Use GLUT timers for joysticks... */
/* XXX Dumb; forces granularity to .01sec */
- if( fghHaveJoystick( ) && ( msec < 10 ) )
+ if( fghHaveJoystick( ) && ( msec > 10 ) )
msec = 10;

#if TARGET_HOST_UNIX_X11

An example program to trigger this bug is attached.
Running under Linux, it will not get joystick events
unless something else interrupts fghSleepForEvents()
such as the mouse moving over the window.

Discussion

  • Dan Torop
    Dan Torop
    2005-05-23

    timertest.c

     
    Attachments
  • Logged In: YES
    user_id=71128

    Tested, confirmed with a Saitek Cyborg Evo, checked into CVS
    @ 2106 EDT 25 May 05.

     
    • assigned_to: nobody --> puggles
    • status: open --> closed-accepted