- /*
- * Make sure the context is direct when the user wants it forced
- */
- if( fgState.ForceDirectContext && !glXIsDirect( fgDisplay.Display, window->Window.Context ) )
- fgError( "unable to force direct context rendering for window '%s'", title );
+ /* window->Window.Context = fgStructure.MenuContext->Context; */
+ window->Window.Context = glXCreateContext(
+ fgDisplay.Display, window->Window.VisualInfo,
+ NULL, ( fgState.DirectContext != GLUT_FORCE_INDIRECT_CONTEXT )
+ );
+ }
+ else if( fgState.UseCurrentContext )
+ {
+ window->Window.Context = glXGetCurrentContext( );
+
+ if( ! window->Window.Context )
+ window->Window.Context = glXCreateContext(
+ fgDisplay.Display, window->Window.VisualInfo,
+ NULL, ( fgState.DirectContext != GLUT_FORCE_INDIRECT_CONTEXT )
+ );
+ }
+ else
+ window->Window.Context = glXCreateContext(
+ fgDisplay.Display, window->Window.VisualInfo,
+ NULL, ( fgState.DirectContext != GLUT_FORCE_INDIRECT_CONTEXT )
+ );
+
+#if !defined( __FreeBSD__ ) && !defined( __NetBSD__ )
+ if( !glXIsDirect( fgDisplay.Display, window->Window.Context ) )
+ {
+ if( fgState.DirectContext == GLUT_FORCE_DIRECT_CONTEXT )
+ fgError( "Unable to force direct context rendering for window '%s'",
+ title );
+ else if( fgState.DirectContext == GLUT_TRY_DIRECT_CONTEXT )
+ fgWarning( "Unable to create direct context rendering for window '%s'\nThis may hurt performance.",
+ title );
+ }
+#endif