72, /* GameModeRefresh */
GLUT_ACTION_EXIT, /* ActionOnWindowClose */
GLUT_EXEC_STATE_INIT, /* ExecState */
- NULL /* ProgramName */
+ NULL, /* ProgramName */
+ GL_FALSE /* JoysticksInitialised */
};
/*
* A call to this function should initialize all the display stuff...
*/
-void fgInitialize( const char* displayName )
+static void fghInitialize( const char* displayName )
{
#if TARGET_HOST_UNIX_X11
fgDisplay.Display = XOpenDisplay( displayName );
#endif
-#if !TARGET_HOST_WINCE
- fgJoystickInit( 0 );
- fgJoystickInit( 1 );
-#endif /* !TARGET_HOST_WINCE */
-
fgState.Initialised = GL_TRUE;
}
}
#if !TARGET_HOST_WINCE
- fgJoystickClose( );
+ if ( fgState.JoysticksInitialised )
+ fgJoystickClose( );
#endif /* !TARGET_HOST_WINCE */
+ fgState.JoysticksInitialised = GL_FALSE;
fgState.Initialised = GL_FALSE;
* in the program arguments, we will use the DISPLAY environment
* variable for opening the X display (see code above):
*/
- fgInitialize( displayName );
+ fghInitialize( displayName );
/*
* Geometry parsing deffered until here because we may need the screen