+static void SetWindowCallbacks( int first )
+{
+ /* All these callbacks are set for only the current window */
+ glutDisplayFunc( Display );
+ glutReshapeFunc( Reshape );
+ glutPositionFunc( Position );
+ glutKeyboardFunc( Key );
+ glutSpecialFunc( Special );
+ glutKeyboardUpFunc( KeyUp );
+ glutSpecialUpFunc( SpecialUp );
+ if (first)
+ glutJoystickFunc( Joystick, 100 );
+ glutMouseFunc ( Mouse ) ;
+ glutMouseWheelFunc ( MouseWheel ) ;
+ glutMotionFunc ( Motion ) ;
+ glutPassiveMotionFunc ( PassiveMotion ) ;
+ glutEntryFunc ( Entry ) ;
+ glutCloseFunc ( Close ) ;
+ glutOverlayDisplayFunc ( OverlayDisplay ) ;
+ glutSpaceballMotionFunc ( SpaceMotion ) ;
+ glutSpaceballRotateFunc ( SpaceRotation ) ;
+ glutSpaceballButtonFunc ( SpaceButton ) ;
+ glutButtonBoxFunc ( ButtonBox ) ;
+ glutDialsFunc ( Dials ) ;
+ glutTabletMotionFunc ( TabletMotion ) ;
+ glutTabletButtonFunc ( TabletButton ) ;
+ /* glutVisibilityFunc is deprecated in favor of glutWindowStatusFunc, which provides more detail.
+ * Setting one of these overwrites the other (see docs).
+ */
+ glutVisibilityFunc ( Visibility ); /* This will thus never be called, as glutWindowStatusFunc is set afterwards */
+ glutWindowStatusFunc ( WindowStatus ) ;
+}
+