- fgState.DisplayMode |= GLUT_DOUBLE ;
- window->Window.VisualInfo = fgChooseVisual();
- /* OK, we got a double-buffered window, but we only wanted
- * single-buffered. Clear the double-buffer flag now.
- */
- fgState.DisplayMode &= ~GLUT_DOUBLE ;
- }
-
- /*
- * GLUT also checks for multi-sampling, but I don't see that anywhere else in FREEGLUT
- * so I won't bother with it for the moment.
- */
- }
-
- assert( window->Window.VisualInfo != NULL );
-
- /*
- * Have the windows attributes set
- *
- * HINT: the masks should be updated when adding/removing callbacks.
- * This might speed up message processing. Is that true?
- */
- winAttr.event_mask = StructureNotifyMask | SubstructureNotifyMask | ExposureMask |
- ButtonPressMask | ButtonReleaseMask | KeyPressMask | KeyRelease |
- VisibilityChangeMask | EnterWindowMask | LeaveWindowMask |
- PointerMotionMask | ButtonMotionMask;
- winAttr.background_pixmap = None;
- winAttr.background_pixel = 0;
- winAttr.border_pixel = 0;
+ if( !( fgState.DisplayMode & GLUT_DOUBLE ) )
+ {
+ fgState.DisplayMode |= GLUT_DOUBLE ;
+ window->Window.VisualInfo = fgChooseVisual( );
+ fgState.DisplayMode &= ~GLUT_DOUBLE;
+ }