GL_FALSE, /* GLDebugSwitch */
GL_FALSE, /* XSyncSwitch */
GLUT_KEY_REPEAT_ON, /* KeyRepeat */
- 0xffffffff, /* Modifiers */
+ INVALID_MODIFIERS, /* Modifiers */
0, /* FPSInterval */
0, /* SwapCount */
0, /* SwapTime */
GLUT_ACTION_EXIT, /* ActionOnWindowClose */
GLUT_EXEC_STATE_INIT, /* ExecState */
NULL, /* ProgramName */
- GL_FALSE /* JoysticksInitialised */
+ GL_FALSE, /* JoysticksInitialised */
+ GL_FALSE /* InputDevsInitialised */
};
#endif
fgState.Initialised = GL_TRUE;
+
+ /* InputDevice uses GlutTimerFunc(), so fgState.Initialised must be TRUE */
+ fgInitialiseInputDevices();
}
/*
/* If there was a menu created, destroy the rendering context */
if( fgStructure.MenuContext )
{
+#if TARGET_HOST_UNIX_X11
+ /* Note that the MVisualInfo is not owned by the MenuContext! */
+ glXDestroyContext( fgDisplay.Display, fgStructure.MenuContext->MContext );
+#endif
free( fgStructure.MenuContext );
fgStructure.MenuContext = NULL;
}
#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;
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;