*/
SFG_Menu* fgCreateMenu( FGCBMenu menuCallback )
{
- int x = 100, y = 100, w = 1, h = 1;
SFG_Window *current_window = fgStructure.CurrentWindow;
/* Have the menu object created */
menu->ParentWindow = NULL;
/* Create a window for the menu to reside in. */
-
- fgCreateWindow( NULL, "freeglut menu", GL_TRUE, x, y, GL_TRUE, w, h,
+ fgCreateWindow( NULL, "freeglut menu", GL_FALSE, 0, 0, GL_FALSE, 0, 0,
GL_FALSE, GL_TRUE );
menu->Window = fgStructure.CurrentWindow;
glutDisplayFunc( fgDisplayMenu );
- glutHideWindow( ); /* Hide the window for now */
fgSetWindow( current_window );
/* Initialize the object properties: */
GLboolean sizeUse, int w, int h,
GLboolean gameMode, GLboolean isSubWindow )
{
- fgPlatformOpenWindow( window, title,
- positionUse, x, y,
- sizeUse, w, h,
- gameMode, isSubWindow );
+ fgPlatformOpenWindow( window, title,
+ positionUse, x, y,
+ sizeUse, w, h,
+ gameMode, isSubWindow );
fgSetWindow( window );
}
if( !sizeUse )
{
- if( !window->IsMenu )
- {
- w = CW_USEDEFAULT;
- h = CW_USEDEFAULT;
- }
- else /* fail safe - Windows can make a window of size (0, 0) */
- w = h = 300; /* default window size */
+ w = CW_USEDEFAULT;
+ h = CW_USEDEFAULT;
}
-
-#if !defined(_WIN32_WCE) /* no decorations for windows CE */
- if( sizeUse )
+#if !defined(_WIN32_WCE) /* no decorations for windows CE, so nothing to do */
+ else
{
RECT windowRect;
/*
#if defined(_WIN32_WCE)
ShowWindow( window->Window.Handle, SW_SHOW );
#else
+ if (!window->IsMenu) /* Don't show window after creation if its a menu */
{
- BOOL iconic = fgState.ForceIconic && !window->IsMenu && !gameMode && !isSubWindow;
+ BOOL iconic = fgState.ForceIconic && !gameMode && !isSubWindow;
ShowWindow( window->Window.Handle,
iconic ? SW_SHOWMINIMIZED : SW_SHOWNORMAL );
}
}
#endif
- /*
- * XXX Assume the new window is visible by default
- * XXX Is this a safe assumption?
- */
- window->State.Visible = GL_TRUE;
-
sizeHints.flags = 0;
if ( positionUse )
sizeHints.flags |= USPosition;
fgRegisterDevices( fgDisplay.pDisplay.Display, &(window->Window.Handle) );
#endif
- XMapWindow( fgDisplay.pDisplay.Display, window->Window.Handle );
+ if (!window->IsMenu) /* Don't show window after creation if its a menu */
+ {
+ XMapWindow( fgDisplay.pDisplay.Display, window->Window.Handle );
+ window->State.Visible = GL_TRUE;
+ }
XFree(visualInfo);