if user opens menu in parent window and then clicked child window, the menu wasn...
[freeglut] / src / fg_window.c
index 06efa03..3b61192 100644 (file)
@@ -28,6 +28,7 @@
 #define FREEGLUT_BUILDING_LIB
 #include <GL/freeglut.h>
 #include "fg_internal.h"
+#include "fg_gl2.h"
 
 /*
  * TODO BEFORE THE STABLE RELEASE:
@@ -145,6 +146,12 @@ void fgOpenWindow( SFG_Window* window, const char* title,
         glReadBuffer ( GL_FRONT );
     }
 #endif
+    window->Window.attribute_v_coord = -1;
+    window->Window.attribute_v_normal = -1;
+
+    fgInitGL2();
+
+    window->State.NeedToInitContext = GL_TRUE;
 }
 
 /*
@@ -319,8 +326,6 @@ void FGAPIENTRY glutIconifyWindow( void )
     FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutIconifyWindow" );
     FREEGLUT_EXIT_IF_NO_WINDOW ( "glutIconifyWindow" );
 
-    fgStructure.CurrentWindow->State.Visible   = GL_FALSE;
-
        fgPlatformGlutIconifyWindow ();
 
     fgStructure.CurrentWindow->State.Redisplay = GL_FALSE;