fgStructure.GameMode = fgCreateWindow(
NULL, "FREEGLUT", 0, 0,
- fgState.GameModeSize.X, fgState.GameModeSize.Y, GL_TRUE
+ fgState.GameModeSize.X, fgState.GameModeSize.Y, GL_TRUE, GL_FALSE
);
#if TARGET_HOST_UNIX_X11
#endif
{ NULL, NULL }, /* Timers */
NULL, /* IdleCallback */
- GL_FALSE, /* BuildingAMenu */
0, /* ActiveMenus */
NULL, /* MenuStateCallback */
NULL, /* MenuStatusCallback */
FGCBIdle IdleCallback; /* The global idle callback */
- GLboolean BuildingAMenu; /* Are we presently making a menu */
int ActiveMenus; /* Num. of currently active menus */
FGCBMenuState MenuStateCallback; /* Menu callbacks are global */
FGCBMenuStatus MenuStatusCallback;
* Defined in freeglut_structure.c, freeglut_window.c.
*/
SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title,
- int x, int y, int w, int h, GLboolean gameMode );
+ int x, int y, int w, int h,
+ GLboolean gameMode, GLboolean isMenu );
void fgSetWindow ( SFG_Window *window );
void fgOpenWindow( SFG_Window* window, const char* title,
int x, int y, int w, int h, GLboolean gameMode,
window->Window.Handle = hWnd;
window->Window.Device = GetDC( hWnd );
- if( fgState.BuildingAMenu )
+ if( window->IsMenu )
{
unsigned int current_DisplayMode = fgState.DisplayMode;
fgState.DisplayMode = GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH;
* If parent is set to NULL, the window created will be a topmost one.
*/
SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title,
- int x, int y, int w, int h, GLboolean gameMode )
+ int x, int y, int w, int h,
+ GLboolean gameMode, GLboolean isMenu )
{
/*
* Have the window object created
window->State.Cursor = GLUT_CURSOR_INHERIT;
window->State.Modifiers = 0xffffffff;
- window->IsMenu = fgState.BuildingAMenu ;
+ window->IsMenu = isMenu;
/*
* Open the window now. The fgOpenWindow() function is system
menu->ParentWindow = fgStructure.Window;
/*
- * Create a window for the menu to reside in. Set the
- * global variable BuildingAMenu to true so we can ensure
- * it is created without decorations.
+ * Create a window for the menu to reside in.
*/
- fgState.BuildingAMenu = GL_TRUE;
- fgCreateWindow( NULL, NULL, x, y, w, h, GL_FALSE );
+ fgCreateWindow( NULL, NULL, x, y, w, h, GL_FALSE, GL_TRUE );
menu->Window = fgStructure.Window;
glutDisplayFunc( fgDisplayMenu );
- /*
- * While BuildingAMenu is true, all windows built have no decorations.
- * That's not a good default behavior, so let's set it false again.
- */
- fgState.BuildingAMenu = GL_FALSE;
-
glutHideWindow( ); /* Hide the window for now */
fgSetWindow( current_window );
* XXX With a little thought, we should be able to greatly
* XXX simplify this.
*/
- if ( !fgState.BuildingAMenu )
+ if ( !window->IsMenu )
window->Window.VisualInfo = fgChooseVisual();
else if ( fgStructure.MenuContext )
window->Window.VisualInfo = fgChooseVisual();
mask = CWBackPixmap | CWBorderPixel | CWColormap | CWEventMask;
- if ( fgState.BuildingAMenu )
+ if ( window->IsMenu )
{
winAttr.override_redirect = True;
mask |= CWOverrideRedirect;
* The GLX context creation, possibly trying the direct context rendering
* or else use the current context if the user has so specified
*/
- if ( fgState.BuildingAMenu )
+ if ( window->IsMenu )
{
/*
* If there isn't already an OpenGL rendering context for menu
int FGAPIENTRY glutCreateWindow( const char* title )
{
return fgCreateWindow( NULL, title, fgState.Position.X, fgState.Position.Y,
- fgState.Size.X, fgState.Size.Y, GL_FALSE )->ID;
+ fgState.Size.X, fgState.Size.Y, GL_FALSE,
+ GL_FALSE )->ID;
}
/*
freeglut_assert_ready;
parent = fgWindowByID( parentID );
freeglut_return_val_if_fail( parent != NULL, 0 );
- window = fgCreateWindow( parent, "", x, y, w, h, GL_FALSE );
+ window = fgCreateWindow( parent, "", x, y, w, h, GL_FALSE, GL_FALSE );
return window->ID;
}