X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_init.c;h=a8a59d4784c751c4b035e3869c7802cf5399db37;hb=e9a96a71a2feff9da7ccae395c5f316e67af3bd0;hp=078192c5684b456bd1b5773aaac32a0f5adef3fe;hpb=e168af86e8c8ab1ac30817bb570b374964da72a2;p=freeglut diff --git a/src/freeglut_init.c b/src/freeglut_init.c index 078192c..a8a59d4 100644 --- a/src/freeglut_init.c +++ b/src/freeglut_init.c @@ -61,7 +61,7 @@ SFG_State fgState = { { -1, -1, GL_FALSE }, /* Position */ GL_FALSE, /* GLDebugSwitch */ GL_FALSE, /* XSyncSwitch */ GLUT_KEY_REPEAT_ON, /* KeyRepeat */ - 0xffffffff, /* Modifiers */ + INVALID_MODIFIERS, /* Modifiers */ 0, /* FPSInterval */ 0, /* SwapCount */ 0, /* SwapTime */ @@ -82,7 +82,8 @@ SFG_State fgState = { { -1, -1, GL_FALSE }, /* Position */ GLUT_ACTION_EXIT, /* ActionOnWindowClose */ GLUT_EXEC_STATE_INIT, /* ExecState */ NULL, /* ProgramName */ - GL_FALSE /* JoysticksInitialised */ + GL_FALSE, /* JoysticksInitialised */ + GL_FALSE /* InputDevsInitialised */ }; @@ -202,6 +203,9 @@ static void fghInitialize( const char* displayName ) #endif fgState.Initialised = GL_TRUE; + + /* InputDevice uses GlutTimerFunc(), so fgState.Initialised must be TRUE */ + fgInitialiseInputDevices(); } /* @@ -242,8 +246,12 @@ void fgDeinitialize( void ) #if !TARGET_HOST_WINCE if ( fgState.JoysticksInitialised ) fgJoystickClose( ); + + if ( fgState.InputDevsInitialised ) + fgInputDeviceClose( ); #endif /* !TARGET_HOST_WINCE */ fgState.JoysticksInitialised = GL_FALSE; + fgState.InputDevsInitialised = GL_FALSE; fgState.Initialised = GL_FALSE; @@ -266,7 +274,7 @@ void fgDeinitialize( void ) fgState.ExecState = GLUT_EXEC_STATE_INIT; fgState.KeyRepeat = GLUT_KEY_REPEAT_ON; - fgState.Modifiers = 0xffffffff; + fgState.Modifiers = INVALID_MODIFIERS; fgState.GameModeSize.X = 640; fgState.GameModeSize.Y = 480;