- /*
- * Create the OpenGL rendering context now
- */
- window->Window.Context = wglCreateContext( window->Window.Device );
+ /*
+ * If there isn't already an OpenGL rendering context for menu windows, make one
+ */
+ if ( !fgStructure.MenuContext )
+ {
+ fgStructure.MenuContext = (SFG_MenuContext *)malloc ( sizeof(SFG_MenuContext) ) ;
+ fgStructure.MenuContext->Context = wglCreateContext( window->Window.Device );
+ }
+ else
+ wglMakeCurrent ( window->Window.Device, fgStructure.MenuContext->Context ) ;
+
+/* window->Window.Context = wglGetCurrentContext () ; */
+ window->Window.Context = wglCreateContext( window->Window.Device );
+ }
+ else
+ {
+ /*
+ * Setup the pixel format of our window
+ */
+ fgSetupPixelFormat( window, FALSE, PFD_MAIN_PLANE );
+
+ if ( fgState.UseCurrentContext == TRUE )
+ {
+ window->Window.Context = wglGetCurrentContext();
+ if ( ! window->Window.Context )
+ window->Window.Context = wglCreateContext( window->Window.Device );
+ }
+ else
+ window->Window.Context = wglCreateContext( window->Window.Device );
+ }